|
||||||||||
| 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 ConfigurableComponentIConfigurationExceptionpublic void finishConfiguration(GameManagerI gameManager)
ConfigurableComponentIThis 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 ConfigurableComponentIgameManager - 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 PhaseIpublic java.lang.String getInfo()
getInfo in interface PhaseIpublic boolean isTileColourAllowed(java.lang.String tileColour)
isTileColourAllowed in interface PhaseIpublic java.util.Map<java.lang.String,java.lang.Integer> getTileColours()
getTileColours in interface PhaseIpublic java.lang.String getTileColoursString()
public int getIndex()
getIndex in interface PhaseIpublic java.lang.String getName()
getName in interface PhaseIpublic boolean doPrivatesClose()
doPrivatesClose in interface PhaseIpublic boolean isPrivateSellingAllowed()
isPrivateSellingAllowed in interface PhaseIpublic int getPrivatesRevenueStep()
getPrivatesRevenueStep in interface PhaseIpublic boolean isTrainTradingAllowed()
isTrainTradingAllowed in interface PhaseIpublic boolean canBuyMoreTrainsPerTurn()
canBuyMoreTrainsPerTurn in interface PhaseIpublic boolean canBuyMoreTrainsPerTypePerTurn()
canBuyMoreTrainsPerTypePerTurn in interface PhaseIpublic boolean isLoanTakingAllowed()
isLoanTakingAllowed in interface PhaseIpublic int getNumberOfOperatingRounds()
getNumberOfOperatingRounds in interface PhaseIpublic int getOffBoardRevenueStep()
getOffBoardRevenueStep in interface PhaseIpublic void addObjectToClose(Closeable object)
addObjectToClose in interface PhaseIpublic java.lang.String getParameterAsString(java.lang.String key)
getParameterAsString in interface PhaseIpublic int getParameterAsInteger(java.lang.String key)
getParameterAsInteger in interface PhaseIpublic 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 | |||||||||