From 8323707d3a2945f8fbd4d4e925a04d1eb6f0a3b7 Mon Sep 17 00:00:00 2001 From: sanine Date: Sat, 11 Nov 2023 14:14:30 -0600 Subject: prevent movement when frozen and allow seeing past the lattice edge --- src/simulation/actions.test.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/simulation/actions.test.js') 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([]); +}); -- cgit v1.2.1