public class GameController
extends java.lang.Object
Constructor and Description |
---|
GameController(GameControllerAdapter adapter,
int width,
int height,
int gridSize,
int numberOfCheese)
Creates an instance of the controller.
|
Modifier and Type | Method and Description |
---|---|
void |
causeMouseMove(MouseController mouse,
int move)
Causes the Mouse to move based on its move decision
|
int |
getGridLeft(int x)
Gets the actual X-axis on the game interface given the maze X-axis value.
|
int |
getGridTop(int y)
Gets the actual Y-axis on the game interface given the maze Y-axis value.
|
Maze |
getMaze()
Retrieve the maze that was generated by the controller.
|
int |
getMouseNextMove(MouseController mouse,
Grid targetGrid)
Get the next move made by the mouse implementation.
|
Grid |
report(MouseRepresent represent,
int xOnField,
int yOnField)
All instances of Mouse will report its location on the maze.
|
void |
start()
Causes the game to begin.
|
public GameController(GameControllerAdapter adapter, int width, int height, int gridSize, int numberOfCheese)
adapter
- The adapter that is responsible for picking up events from the controller and manipulate the game interface.width
- The number of horizontal grids.height
- The number of vertical grids.gridSize
- The width and height of each cell.numberOfCheese
- The number of cheese to play for.public Maze getMaze()
public void start()
public Grid report(MouseRepresent represent, int xOnField, int yOnField)
represent
- The MouseRepresent that is representing an instance of the Mouse on the game interface.xOnField
- The actual X location of the mouse on the actual Maze (UI).yOnField
- The actual Y location of the mouse on the actual Maze (UI).public int getMouseNextMove(MouseController mouse, Grid targetGrid)
mouse
- The Mouse in question to get its next move.targetGrid
- The grid the Mouse is currently atpublic void causeMouseMove(MouseController mouse, int move)
mouse
- The Mouse in question to movemove
- The move that Mouse is going to takepublic int getGridLeft(int x)
x
- The X-axis value on the maze.public int getGridTop(int y)
y
- The Y-axis value on the maze.