Currently when updating the WorldState, the collisions and the explosions are reset before being transmitted to the players. This is because DecrementStun returns a new modified, and unfortunately incomplete, copy of the world.
This PR fixes that problem and adds a test to detect the same problem in the future. To prevent similar problems in the future, this is done by introducing a set of "with" methods (withTiles, withCollisions, and withExplosions). These methods return an updated copy of the world, and are easier to maintain than when adding new properties in the future.
Currently when updating the
WorldState
, thecollisions
and theexplosions
are reset before being transmitted to the players. This is becauseDecrementStun
returns a new modified, and unfortunately incomplete, copy of the world.This PR fixes that problem and adds a test to detect the same problem in the future. To prevent similar problems in the future, this is done by introducing a set of "with" methods (
withTiles
,withCollisions
, andwithExplosions
). These methods return an updated copy of the world, and are easier to maintain than when adding new properties in the future.