Holger's
Java API

com.antelmann.game
Class MoveTemplate

java.lang.Object
  extended by com.antelmann.game.MoveTemplate
All Implemented Interfaces:
GameMove, Serializable

public class MoveTemplate
extends 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.

Author:
Holger Antelmann
See Also:
GameMove, GamePlay, Serialized Form

Field Summary
protected  int player
           
 
Constructor Summary
MoveTemplate(int player)
           
 
Method Summary
 boolean equals(Object obj)
           
 int getPlayer()
          returns the game player role that plays this move
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

player

protected int player
Constructor Detail

MoveTemplate

public MoveTemplate(int player)
Method Detail

getPlayer

public int getPlayer()
Description copied from interface: GameMove
returns the game player role that plays this move

Specified by:
getPlayer in interface GameMove
See Also:
GamePlay.numberOfPlayers()

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


(c) 2001-2006 Holger Antelmann - all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads