public class MouseRepresent
extends java.lang.Object
Constructor and Description |
---|
MouseRepresent(GameController controller,
MouseController mouse,
ImagedPanel represent,
javax.swing.JLabel nameLabel,
javax.swing.JLabel cheeseLabel,
java.lang.String upAsset,
java.lang.String downAsset,
java.lang.String leftAsset,
java.lang.String rightAsset)
Creates a new instance of the MouseRepresent
|
Modifier and Type | Method and Description |
---|---|
Grid |
control()
This method is responsible for moving the mouse towards it target grid.
|
void |
displayCheeseNumber() |
MouseController |
getMouseController()
Gets The MouseController whose Mouse is represented by MouseRepresent
|
java.lang.String |
getName() |
int |
getNextMove(Grid targetGrid)
Gets the Mouse's next move
|
javax.swing.JPanel |
getRepresent()
Gets the JPanel that represents the Mouse.
|
void |
moveMouse(int move)
Causes the mouse to move
|
void |
retire()
Causes the Mouse to display that is has retired.
|
public MouseRepresent(GameController controller, MouseController mouse, ImagedPanel represent, javax.swing.JLabel nameLabel, javax.swing.JLabel cheeseLabel, java.lang.String upAsset, java.lang.String downAsset, java.lang.String leftAsset, java.lang.String rightAsset)
controller
- The game controller, hosting the game.mouse
- The MouseController that will be represented by the MouseRepresentrepresent
- The ImagedPanel that will display the Mouse on the game interfacenameLabel
- The Label that will display the Mouse name on the game interfaceupAsset
- The asset that display the Mouse going upwarddownAsset
- The asset that display the Mouse going downwardleftAsset
- The asset that display the Mouse going leftrightAsset
- The asset that display the Mouse going rightpublic java.lang.String getName()
public Grid control() throws java.io.IOException
java.io.IOException
- An IOException can occur if the assets required are missingpublic int getNextMove(Grid targetGrid)
targetGrid
- The grid the Mouse is currently atpublic void moveMouse(int move)
move
- The move decision made by the Mouse.public void displayCheeseNumber()
public javax.swing.JPanel getRepresent()
public MouseController getMouseController()
public void retire()