lab1
Class GameModel

java.lang.Object
  extended by lab1.GameModel
Direct Known Subclasses:
GoldModel

public abstract class GameModel
extends java.lang.Object

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

getGameboardState

public GameTile getGameboardState(Position pos)
Returns the GameTile in logical position (x,y) of the gameboard.

Parameters:
pos - The position in the gameboard matrix.

getGameboardState

public GameTile getGameboardState(int x,
                                  int y)
Returns the GameTile in logical position (x,y) of the gameboard.

Parameters:
x - Coordinate in the gameboard matrix.
y - Coordinate in the gameboard matrix.

getGameboardSize

public java.awt.Dimension getGameboardSize()
Returns the size of the gameboard.


gameUpdate

public abstract void gameUpdate(int lastKey)
                         throws GameOverException
This method is called repeatedly so that the game can update it's state.

Parameters:
lastKey - The most recent keystroke.
Throws:
GameOverException