|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrails.game.Phase
public class Phase
Field Summary | |
---|---|
protected java.util.List<Closeable> |
closedObjects
Items to close if a phase gets activated |
protected java.lang.String |
colourList
|
protected Phase |
defaults
Previous phase, defining the current one's defaults |
protected java.lang.String |
extraInfo
|
protected int |
index
|
protected boolean |
loanTakingAllowed
Is loan taking allowed |
protected static org.apache.log4j.Logger |
log
|
protected java.lang.String |
name
|
protected int |
numberOfOperatingRounds
|
protected int |
offBoardRevenueStep
|
protected boolean |
oneTrainPerTurn
May company buy more than one Train from the Bank per turn? |
protected boolean |
oneTrainPerTypePerTurn
May company buy more than one Train of each type from the Bank per turn? |
protected java.util.Map<java.lang.String,java.lang.String> |
parameters
A HashMap to contain phase-dependent parameters by name and value. |
protected boolean |
privatesClose
|
protected boolean |
privateSellingAllowed
|
protected int |
privatesRevenueStep
|
protected java.util.HashMap<java.lang.String,java.lang.Integer> |
tileColours
|
protected boolean |
trainTradingAllowed
|
Constructor Summary | |
---|---|
Phase(int index,
java.lang.String name,
Phase previousPhase)
|
Method Summary | |
---|---|
void |
activate()
Called when a phase gets activated |
void |
addObjectToClose(Closeable object)
|
boolean |
canBuyMoreTrainsPerTurn()
|
boolean |
canBuyMoreTrainsPerTypePerTurn()
|
void |
configureFromXML(Tag tag)
Instructs the component to configure itself from the provided XML element. |
boolean |
doPrivatesClose()
|
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. |
java.util.List<Closeable> |
getClosedObjects()
|
int |
getIndex()
|
java.lang.String |
getInfo()
|
java.lang.String |
getName()
|
int |
getNumberOfOperatingRounds()
|
int |
getOffBoardRevenueStep()
|
int |
getParameterAsInteger(java.lang.String key)
|
java.lang.String |
getParameterAsString(java.lang.String key)
|
int |
getPrivatesRevenueStep()
|
java.util.Map<java.lang.String,java.lang.Integer> |
getTileColours()
|
java.lang.String |
getTileColoursString()
|
boolean |
isLoanTakingAllowed()
|
boolean |
isPrivateSellingAllowed()
|
boolean |
isTileColourAllowed(java.lang.String tileColour)
|
boolean |
isTrainTradingAllowed()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int index
protected java.lang.String name
protected java.lang.String colourList
protected java.util.HashMap<java.lang.String,java.lang.Integer> tileColours
protected boolean privateSellingAllowed
protected boolean privatesClose
protected int numberOfOperatingRounds
protected int offBoardRevenueStep
protected int privatesRevenueStep
protected boolean trainTradingAllowed
protected boolean oneTrainPerTurn
protected boolean oneTrainPerTypePerTurn
protected boolean loanTakingAllowed
protected Phase defaults
protected java.util.List<Closeable> closedObjects
protected java.lang.String extraInfo
protected java.util.Map<java.lang.String,java.lang.String> parameters
protected static org.apache.log4j.Logger log
Constructor Detail |
---|
public Phase(int index, java.lang.String name, Phase previousPhase)
Method Detail |
---|
public void configureFromXML(Tag tag) throws ConfigurationException
ConfigurableComponentI
configureFromXML
in interface ConfigurableComponentI
ConfigurationException
public void finishConfiguration(GameManagerI gameManager)
ConfigurableComponentI
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.
finishConfiguration
in interface ConfigurableComponentI
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.public void activate()
activate
in interface PhaseI
public java.lang.String getInfo()
getInfo
in interface PhaseI
public boolean isTileColourAllowed(java.lang.String tileColour)
isTileColourAllowed
in interface PhaseI
public java.util.Map<java.lang.String,java.lang.Integer> getTileColours()
getTileColours
in interface PhaseI
public java.lang.String getTileColoursString()
public int getIndex()
getIndex
in interface PhaseI
public java.lang.String getName()
getName
in interface PhaseI
public boolean doPrivatesClose()
doPrivatesClose
in interface PhaseI
public boolean isPrivateSellingAllowed()
isPrivateSellingAllowed
in interface PhaseI
public int getPrivatesRevenueStep()
getPrivatesRevenueStep
in interface PhaseI
public boolean isTrainTradingAllowed()
isTrainTradingAllowed
in interface PhaseI
public boolean canBuyMoreTrainsPerTurn()
canBuyMoreTrainsPerTurn
in interface PhaseI
public boolean canBuyMoreTrainsPerTypePerTurn()
canBuyMoreTrainsPerTypePerTurn
in interface PhaseI
public boolean isLoanTakingAllowed()
isLoanTakingAllowed
in interface PhaseI
public int getNumberOfOperatingRounds()
getNumberOfOperatingRounds
in interface PhaseI
public int getOffBoardRevenueStep()
getOffBoardRevenueStep
in interface PhaseI
public void addObjectToClose(Closeable object)
addObjectToClose
in interface PhaseI
public java.lang.String getParameterAsString(java.lang.String key)
getParameterAsString
in interface PhaseI
public int getParameterAsInteger(java.lang.String key)
getParameterAsInteger
in interface PhaseI
public java.util.List<Closeable> getClosedObjects()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |