diff options
Diffstat (limited to 'src/simulation/postprocess.js')
-rw-r--r-- | src/simulation/postprocess.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/simulation/postprocess.js b/src/simulation/postprocess.js new file mode 100644 index 0000000..d50839e --- /dev/null +++ b/src/simulation/postprocess.js @@ -0,0 +1,18 @@ +'use strict'; + +export const postprocess = [ + (world) => ({ + ...world, + agents: world.agents.map(a => { + const {x, y} = a; + if ( + world.lattice[y][x].type === 'mutable' || + world.lattice[y][x].type === 'active' + ) { + return { ...a, flags: {...a.flags, frozen: true } }; + } else { + return a; + } + }), + }), +]; |