Implement a Simulator module that takes the level state and a command, and computes the next level state after executing the given step.
The Simulator should have only have a next() method on its interface. Game manager will call this method passing its current level state and the next command in the user input sequence to get a new level state.
Simulator should return updated versions of all the state information specified in the Level State issue page, which currently states the following:
Therefore, the game manager should:
Retrieve the relevant from levelInformation and remember it. Use that information to initialize its state with it.
Have/maintain a state that holds the lit up tiles.
Have/maintain a state that holds character position (i.e. coordinates of a tile unless out of bounds).
Be able to reset/reinitialize these states when needed (i.e. when game state changes).
Implement a
Simulator
module that takes thelevel state
and acommand
, and computes the next level state after executing the given step.The
Simulator
should have only have anext()
method on its interface. Game manager will call this method passing its currentlevel state
and the nextcommand
in the user input sequence to get a newlevel state
.Simulator
should return updated versions of all the state information specified in theLevel State
issue page, which currently states the following: