rails.game
Class PhaseManager
java.lang.Object
rails.game.PhaseManager
- All Implemented Interfaces:
- ConfigurableComponentI
public class PhaseManager
- extends java.lang.Object
- implements ConfigurableComponentI
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
phaseList
protected java.util.ArrayList<Phase> phaseList
phaseMap
protected java.util.HashMap<java.lang.String,Phase> phaseMap
numberOfPhases
protected int numberOfPhases
currentPhase
protected State currentPhase
gameManager
protected GameManagerI gameManager
log
protected static org.apache.log4j.Logger log
PhaseManager
public PhaseManager()
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.
getCurrentPhase
public PhaseI getCurrentPhase()
getCurrentPhaseIndex
public int getCurrentPhaseIndex()
setPhase
public void setPhase(java.lang.String name)
setPhase
protected void setPhase(PhaseI phase)
getPhaseByName
public PhaseI getPhaseByName(java.lang.String name)
hasReachedPhase
public boolean hasReachedPhase(java.lang.String phaseName)
getPhases
public java.util.List<Phase> getPhases()