org.jscience.computing.game
Class MoveTemplate

java.lang.Object
  extended by org.jscience.computing.game.MoveTemplate
All Implemented Interfaces:
java.io.Serializable, GameMove

public class MoveTemplate
extends java.lang.Object
implements GameMove

MoveTemplate just provides a skeleton implementation for the GameMove interface, so you can focus soley on the game specific properties of the GameMove. Move specific distingtions - other than the player role - have to be specified by a subclass. If the only distingtion for a move in a game is who plays the move, however, instances of this class will in fact be sufficient for use in that game.

See Also:
GameMove, GamePlay, Serialized Form

Field Summary
protected  int player
          DOCUMENT ME!
 
Constructor Summary
MoveTemplate(int player)
          Creates a new MoveTemplate object.
 
Method Summary
 boolean equals(java.lang.Object obj)
          DOCUMENT ME!
 int getPlayer()
          DOCUMENT ME!
 java.lang.String toString()
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

player

protected int player
DOCUMENT ME!

Constructor Detail

MoveTemplate

public MoveTemplate(int player)
Creates a new MoveTemplate object.

Parameters:
player - DOCUMENT ME!
Method Detail

getPlayer

public int getPlayer()
DOCUMENT ME!

Specified by:
getPlayer in interface GameMove
Returns:
DOCUMENT ME!
See Also:
GamePlay.numberOfPlayers()

toString

public java.lang.String toString()
DOCUMENT ME!

Overrides:
toString in class java.lang.Object
Returns:
DOCUMENT ME!

equals

public boolean equals(java.lang.Object obj)
DOCUMENT ME!

Overrides:
equals in class java.lang.Object
Parameters:
obj - DOCUMENT ME!
Returns:
DOCUMENT ME!