public class MouseController
extends java.lang.Object
Constructor and Description |
---|
MouseController(Mouse mouse)
Creates a new instance of MouseController
|
Modifier and Type | Method and Description |
---|---|
Mouse |
getMouse()
Get the Mouse wrapped in this MouseController.
|
int |
getNumberOfBombs()
Gets the number of Bombs the Mouse still has.
|
int |
getNumberOfCheese()
Get the number of cheese the current Mouse has consumed thus far.
|
int |
getSpeed()
Get the number of pixels to move per mouse move turn.
|
Grid |
getTargetGrid()
Gets the next grid the mouse is to head to.
|
void |
increaseNumberOfCheese()
Increases the number of cheese consumed by the Mouse.
|
Bomb |
makeBomb()
Creates a new bomb for the Mouse to be planted on the current targetGrid.
|
int |
onGrid(Grid currentGrid,
Cheese cheese)
This method is called each time the mouse reaches a grid.
|
void |
setNumberOfBombs(int numberOfBombs)
Sets the number of Bombs that Mouse will have.
|
void |
setTargetGrid(Grid targetGrid)
Sets the next grid the mouse is heading to.
|
public MouseController(Mouse mouse)
mouse
- The mouse to be wrapped in the controller.public int onGrid(Grid currentGrid, Cheese cheese)
currentGrid
- The current grid the Mouse is at.cheese
- The cheese to seek.public void setTargetGrid(Grid targetGrid)
targetGrid
- The next grid the mouse is heading to.public Grid getTargetGrid()
public Mouse getMouse()
public int getSpeed()
public int getNumberOfCheese()
public void increaseNumberOfCheese()
public int getNumberOfBombs()
public void setNumberOfBombs(int numberOfBombs)
numberOfBombs
- The number of Bombs the Mouse will have.public Bomb makeBomb()