Class CheckGame
java.lang.Object
nz.ac.vuw.ecs.swen225.gp6.domain.IntegrityCheck.CheckGame
This class contains a set of static method to check the integrity of the game.
- before a ping: step is successfully completed (by comparing the previous maze and inv to next ones).
- after a ping: by looking at the new altered domain, and making sure certain rules are always followed.
This class should be UPDATED REGULARLY to keep up with any new futures the game will have.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckCurrentState(Domain domain) Checks the integrity of the maze and inventory of a given game.static voidcheckStateChange(Domain preDomain, Domain afterDomain) Checks the integrity of the game after a ping, and the game state is transitioning a step forward.getAllTiles(Maze maze, TileType type) returns the list of all tiles with given type in the maze.static Tilereturns the first tile with given type in the maze.
-
Constructor Details
-
CheckGame
public CheckGame()
-
-
Method Details
-
checkStateChange
Checks the integrity of the game after a ping, and the game state is transitioning a step forward. (so the domain have correctly transitioned from before ping state to after ping state)- Parameters:
preDomain- the pre-ping domain that will be changed by one stepafterDomain- the post-ping domain that will be compared with the pre-ping one- Throws:
IllegalStateException- in its check methods, to inform if the game is in an invalid state, it must also include string telling which rule has been broken.
-
checkCurrentState
Checks the integrity of the maze and inventory of a given game.- Parameters:
domain- the game that the maze and inventory will be accessed of- Throws:
IllegalStateException- in its check methods, to inform if the game is in an invalid state, it must also include string telling which rule has been broken
-
getTile
returns the first tile with given type in the maze.- Parameters:
maze- maze to check for tiletype- type of tile to find
-
getAllTiles
returns the list of all tiles with given type in the maze.- Parameters:
maze- maze to check for tilestype- type of tile to find
-