public abstract class Mouse
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
BOMB |
static int |
DOWN |
static int |
LEFT |
static int |
RIGHT |
static int |
UP |
Constructor and Description |
---|
Mouse(java.lang.String name)
Creates a new instance of Mouse.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getName()
Get the name of the mouse that appears on the game interface.
|
abstract int |
move(Grid currentGrid,
Cheese cheese)
The move method is called every time a mouse reaches a new grid.
|
abstract void |
newCheese()
This method is called every time a mouse (including own implementation) consumes
a cheese and a new cheese is relocated.
|
abstract void |
respawned()
This method is called every time the Mouse touches a bomb that is not planted by it.
|
public static final int UP
public static final int DOWN
public static final int LEFT
public static final int RIGHT
public static final int BOMB
public Mouse(java.lang.String name)
name
- The name of the Mouse to appear in the game interface.public java.lang.String getName()
public abstract int move(Grid currentGrid, Cheese cheese)
currentGrid
- The current grid the Mouse is at.cheese
- The cheese to be seek.public abstract void newCheese()
public abstract void respawned()