diff options
author | sanine <sanine.not@pm.me> | 2023-11-11 14:14:30 -0600 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2023-11-11 14:14:30 -0600 |
commit | 8323707d3a2945f8fbd4d4e925a04d1eb6f0a3b7 (patch) | |
tree | a78c0957342566e93f9e8045fe0d22fd45818e71 /src/simulation/actions.test.js | |
parent | 78f2f5f4b1ccd58bbdef0d5e5d2dd026ac4ad668 (diff) |
prevent movement when frozen and allow seeing past the lattice edge
Diffstat (limited to 'src/simulation/actions.test.js')
-rw-r--r-- | src/simulation/actions.test.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/simulation/actions.test.js b/src/simulation/actions.test.js index e0b29dc..e8406bc 100644 --- a/src/simulation/actions.test.js +++ b/src/simulation/actions.test.js @@ -280,3 +280,15 @@ test("take flag", () => { expect(take_flag.propose(world, agent, [0])).toEqual([]); }); + + +test("frozen agents cannot move", () => { + const agent = { id: 0, x: 0, y: 0, flags: { orientation: 'n', frozen: true } }; + + const world = { agents: [agent] }; + + expect(move_forward.propose(world, agent, [1])).toEqual([]); + expect(move_backward.propose(world, agent, [1])).toEqual([]); + expect(turn_left.propose(world, agent, [1])).toEqual([]); + expect(turn_right.propose(world, agent, [1])).toEqual([]); +}); |