rails.game.specific._18EU
Class StockRound_18EU

java.lang.Object
  extended by rails.game.Round
      extended by rails.game.StockRound
          extended by rails.game.specific._18EU.StockRound_18EU
All Implemented Interfaces:
RoundI
Direct Known Subclasses:
FinalMinorExchangeRound

public class StockRound_18EU
extends StockRound

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 rails.game.StockRound
adjustSharePrice, buyShares, checkAgainstHoldLimit, done, executeExchangeForShare, executeShareTransfer, gameSpecificChecks, getBuyPrice, getCurrentPlayerIndex, getCurrentSellPrice, getHelp, getRoundName, getSharePriceRecipient, getStockRoundNumber, initPlayer, isPlayerOverLimits, isPlayerOverLimitsDetail, isSaleRecorded, isSellObligationLifted, maxAllowedNumberOfSharesToBuy, mayCurrentPlayerBuyAnything, mayCurrentPlayerSellAnything, mayPlayerBuyCertificate, mayPlayerSellShareOfCompany, noSaleIfNotOperated, noSaleInFirstSR, process, recordSale, releaseCompanyShares, requestTurn, sellShares, setCurrentPlayer, setNextPlayer, setPriority, setSellableShares, setSellObligationLifted, setSpecialActions, useSpecialProperty
 
Methods inherited from class rails.game.Round
canCompanyOperateThisRound, canRequestTurn, certCountsAsSold, checkFlotation, exchangeTokens, getAutopasses, getCurrentPhase, getCurrentPlayer, getGameManager, getGameOption, getGameParameter, getGameParameterAsBoolean, getGameParameterAsInt, getNumberOfActivePlayers, getNumberOfPlayers, getPlayers, getRoundTypeForUI, getSoldPercentage, getSpecialProperties, hasAutopassed, pay, pay, requestTurn, resume, setAutopass, setCanRequestTurn, setCurrentPlayerIndex, setOperatingCompanies, setOperatingCompanies, transferCertificate, transferCertificates, wasInterrupted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

compWithExcessTrains

protected java.util.List<PublicCompanyI> compWithExcessTrains

discardingCompanies

protected PublicCompanyI[] discardingCompanies

discardingCompanyIndex

protected IntegerState discardingCompanyIndex

discardingTrains

protected BooleanState discardingTrains

phase5Reached

protected boolean phase5Reached
Constructor Detail

StockRound_18EU

public StockRound_18EU(GameManagerI aGameManager)
Constructor with the GameManager, will call super class (StockRound's) Constructor to initialize

Parameters:
aGameManager - The GameManager Object needed to initialize the Stock Round
Method Detail

start

public void start()
Overrides:
start in class StockRound

setPossibleActions

public boolean setPossibleActions()
Description copied from class: Round
Default version, does nothing. Subclasses should override this method with a real version.

Specified by:
setPossibleActions in interface RoundI
Overrides:
setPossibleActions in class StockRound

setBuyableCerts

public void setBuyableCerts()
Create a list of certificates that a player may buy in a Stock Round, taking all rules into account.

Overrides:
setBuyableCerts in class StockRound

setGameSpecificActions

protected void setGameSpecificActions()
An 18EU extension to StockRound.setSellableShares() that adds any mergeable Minor companies.

Overrides:
setGameSpecificActions in class StockRound

setTrainDiscardActions

protected boolean setTrainDiscardActions()

startCompany

public boolean startCompany(java.lang.String playerName,
                            StartCompany action)
Start a company by buying one or more shares (more applies to e.g. 1841)

Overrides:
startCompany in class StockRound
Parameters:
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).
Returns:
True if the company could be started. False indicates an error.

processGameSpecificAction

protected boolean processGameSpecificAction(PossibleAction action)
Overrides:
processGameSpecificAction in class StockRound

mergeCompanies

protected boolean mergeCompanies(MergeCompanies action)
Merge a minor into an already started company.

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).

Parameters:
action -
Returns:

floatCompany

protected void floatCompany(PublicCompanyI company)
Description copied from class: Round
Float a company, including a default implementation of moving cash and shares as a result of flotation.

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.

Overrides:
floatCompany in class Round

discardTrain

public boolean discardTrain(DiscardTrain action)

finishTurn

protected void finishTurn()
Overrides:
finishTurn in class StockRound

finishRound

protected void finishRound()
Overrides:
finishRound in class StockRound

toString

public java.lang.String toString()
Overrides:
toString in class StockRound