rails.game
Class PlayerManager

java.lang.Object
  extended by rails.game.PlayerManager
All Implemented Interfaces:
ConfigurableComponentI

public class PlayerManager
extends java.lang.Object
implements ConfigurableComponentI


Field Summary
 int maxPlayers
           
 int minPlayers
           
 
Constructor Summary
PlayerManager()
           
 
Method Summary
 void configureFromXML(Tag tag)
          Instructs the component to configure itself from the provided XML element.
 void finishConfiguration(GameManagerI gameManager)
          This method is intended to be called for each configurable component, to perforn any initialisation activities that require any other components to be initialised first.
 int getInitialPlayerCertificateLimit()
          Only to be called at initialisation time.
 Player getPlayerByName(java.lang.String name)
           
 java.util.List<java.lang.String> getPlayerNames()
           
 java.util.List<Player> getPlayers()
           
protected  int getStartCash()
           
 void setPlayers(java.util.List<java.lang.String> playerNames, Bank bank)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

maxPlayers

public int maxPlayers

minPlayers

public int minPlayers
Constructor Detail

PlayerManager

public PlayerManager()
Method Detail

configureFromXML

public void configureFromXML(Tag tag)
                      throws ConfigurationException
Description copied from interface: ConfigurableComponentI
Instructs the component to configure itself from the provided XML element.

Specified by:
configureFromXML in interface ConfigurableComponentI
Throws:
ConfigurationException

finishConfiguration

public void finishConfiguration(GameManagerI gameManager)
Description copied from interface: ConfigurableComponentI
This method is intended to be called for each configurable component, to perforn any initialisation activities that require any other components to be initialised first. This includes creating any required relationships to other configured components and objects.

This method should be called where necessary after all XML file parsing has completed, so that all objects that need to be related to do exist.

Specified by:
finishConfiguration in interface ConfigurableComponentI
Parameters:
gameManager - The 'parent' configurable component is passed to allow the 'child' to access any other object without the need to resort to static calls where possible.

setPlayers

public void setPlayers(java.util.List<java.lang.String> playerNames,
                       Bank bank)

getPlayers

public java.util.List<Player> getPlayers()
Returns:
Returns an array of all players.

getPlayerByName

public Player getPlayerByName(java.lang.String name)

getPlayerNames

public java.util.List<java.lang.String> getPlayerNames()

getStartCash

protected int getStartCash()

getInitialPlayerCertificateLimit

public int getInitialPlayerCertificateLimit()
Only to be called at initialisation time. Does not reflect later changes to this limit.