games.strategy.common.player
Class AbstractBasePlayer

java.lang.Object
  extended by games.strategy.common.player.AbstractBasePlayer
All Implemented Interfaces:
IGamePlayer
Direct Known Subclasses:
AbstractBaseAI, AbstractHumanPlayer

public abstract class AbstractBasePlayer
extends java.lang.Object
implements IGamePlayer

Author:
Lane Schwartz

Field Summary
protected  IPlayerBridge m_bridge
           
protected  PlayerID m_id
           
protected  java.lang.String m_name
           
 
Constructor Summary
AbstractBasePlayer(java.lang.String name)
           
 
Method Summary
protected  GameData getGameData()
          Get the GameData for the game.
 PlayerID getID()
           
 java.lang.String getName()
           
protected  IPlayerBridge getPlayerBridge()
          Get the IPlayerBridge for this game player.
 void initialize(IPlayerBridge bridge, PlayerID id)
          Called before the game starts.
abstract  void start(java.lang.String stepName)
          The given phase has started.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_name

protected final java.lang.String m_name

m_id

protected PlayerID m_id

m_bridge

protected IPlayerBridge m_bridge
Constructor Detail

AbstractBasePlayer

public AbstractBasePlayer(java.lang.String name)
Parameters:
name - - the name of the player.
Method Detail

initialize

public void initialize(IPlayerBridge bridge,
                       PlayerID id)
Description copied from interface: IGamePlayer
Called before the game starts.

Specified by:
initialize in interface IGamePlayer

getGameData

protected final GameData getGameData()
Get the GameData for the game.


getPlayerBridge

protected final IPlayerBridge getPlayerBridge()
Get the IPlayerBridge for this game player.


getName

public final java.lang.String getName()
Specified by:
getName in interface IGamePlayer
Returns:
the name of the game player

getID

public final PlayerID getID()
Specified by:
getID in interface IGamePlayer
Returns:
the id of this player. This id is initialized by the initialize method.

start

public abstract void start(java.lang.String stepName)
The given phase has started. We parse the phase name and call the apropiate method.

Specified by:
start in interface IGamePlayer