|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrails.game.Round
rails.game.StockRound
rails.game.specific._18EU.StockRound_18EU
public class StockRound_18EU
Implements a basic Stock Round.
A new instance must be created for each new Stock Round. At the end of a round, the current instance should be discarded.
Permanent memory is formed by static attributes (like who has the Priority Deal).
Field Summary | |
---|---|
protected java.util.List<PublicCompanyI> |
compWithExcessTrains
|
protected PublicCompanyI[] |
discardingCompanies
|
protected IntegerState |
discardingCompanyIndex
|
protected BooleanState |
discardingTrains
|
protected boolean |
phase5Reached
|
Fields inherited from class rails.game.StockRound |
---|
BOUGHT, companyBoughtThisTurnWrapper, currentPlayer, hasActed, hasSoldThisTurnBeforeBuying, numberOfPlayers, numPasses, playersThatSoldThisRound, SELL_BUY, SELL_BUY_OR_BUY_SELL, SELL_BUY_SELL, sellObligationLifted, sellPrices, sequenceRule, SOLD, startingPlayer |
Fields inherited from class rails.game.Round |
---|
autopasses, bank, canRequestTurn, companyManager, gameManager, guiHints, hasRequestedTurn, ipo, log, mapManager, moveStack, playerManager, pool, possibleActions, scrapHeap, stockMarket, unavailable, wasInterrupted |
Constructor Summary | |
---|---|
StockRound_18EU(GameManagerI aGameManager)
Constructor with the GameManager, will call super class (StockRound's) Constructor to initialize |
Method Summary | |
---|---|
boolean |
discardTrain(DiscardTrain action)
|
protected void |
finishRound()
|
protected void |
finishTurn()
|
protected void |
floatCompany(PublicCompanyI company)
Float a company, including a default implementation of moving cash and shares as a result of flotation. |
protected boolean |
mergeCompanies(MergeCompanies action)
Merge a minor into an already started company. |
protected boolean |
processGameSpecificAction(PossibleAction action)
|
void |
setBuyableCerts()
Create a list of certificates that a player may buy in a Stock Round, taking all rules into account. |
protected void |
setGameSpecificActions()
An 18EU extension to StockRound.setSellableShares() that adds any mergeable Minor companies. |
boolean |
setPossibleActions()
Default version, does nothing. |
protected boolean |
setTrainDiscardActions()
|
void |
start()
|
boolean |
startCompany(java.lang.String playerName,
StartCompany action)
Start a company by buying one or more shares (more applies to e.g. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.List<PublicCompanyI> compWithExcessTrains
protected PublicCompanyI[] discardingCompanies
protected IntegerState discardingCompanyIndex
protected BooleanState discardingTrains
protected boolean phase5Reached
Constructor Detail |
---|
public StockRound_18EU(GameManagerI aGameManager)
aGameManager
- The GameManager Object needed to initialize the Stock RoundMethod Detail |
---|
public void start()
start
in class StockRound
public boolean setPossibleActions()
Round
setPossibleActions
in interface RoundI
setPossibleActions
in class StockRound
public void setBuyableCerts()
setBuyableCerts
in class StockRound
protected void setGameSpecificActions()
setGameSpecificActions
in class StockRound
protected boolean setTrainDiscardActions()
public boolean startCompany(java.lang.String playerName, StartCompany action)
startCompany
in class StockRound
player
- The player that wants to start a company.company
- The company to start.price
- The start (par) price (ignored if the price is fixed).shares
- The number of shares to buy (can be more than 1 in e.g.
1841).
protected boolean processGameSpecificAction(PossibleAction action)
processGameSpecificAction
in class StockRound
protected boolean mergeCompanies(MergeCompanies action)
Also covers the actions of the Final Minor Exchange Round, in which minors can also be closed (in that case, the MergeCompanies.major attribute is null, which never occurs in normal stock rounds).
action
-
protected void floatCompany(PublicCompanyI company)
Round
Full capitalisation is implemented as in 1830. Partial capitalisation is implemented as in 1851. Other ways to process the consequences of company flotation must be handled in game-specific subclasses.
floatCompany
in class Round
public boolean discardTrain(DiscardTrain action)
protected void finishTurn()
finishTurn
in class StockRound
protected void finishRound()
finishRound
in class StockRound
public java.lang.String toString()
toString
in class StockRound
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |