|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectlab1.GameModel
public abstract class GameModel
Common superclass for all game model classes. Constructors of subclasses should initiate matrix elements and additional, game-dependent fields.
| Method Summary | |
|---|---|
abstract void |
gameUpdate(int lastKey)
This method is called repeatedly so that the game can update it's state. |
java.awt.Dimension |
getGameboardSize()
Returns the size of the gameboard. |
GameTile |
getGameboardState(int x,
int y)
Returns the GameTile in logical position (x,y) of the gameboard. |
GameTile |
getGameboardState(Position pos)
Returns the GameTile in logical position (x,y) of the gameboard. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public GameTile getGameboardState(Position pos)
pos - The position in the gameboard matrix.
public GameTile getGameboardState(int x,
int y)
x - Coordinate in the gameboard matrix.y - Coordinate in the gameboard matrix.public java.awt.Dimension getGameboardSize()
public abstract void gameUpdate(int lastKey)
throws GameOverException
lastKey - The most recent keystroke.
GameOverException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||