rails.game.specific._1856
Class OperatingRound_1856

java.lang.Object
  extended by rails.game.Round
      extended by rails.game.OperatingRound
          extended by rails.game.specific._1856.OperatingRound_1856
All Implemented Interfaces:
java.util.Observer, RoundI

public class OperatingRound_1856
extends OperatingRound


Field Summary
 
Fields inherited from class rails.game.OperatingRound
actionPossible, companiesOperatedThisRound, currentNormalTokenLays, currentSpecialProperties, currentSpecialTokenLays, doneAllowed, excessTrainCompanies, loansThisRound, noMapMode, operatingCompanies, operatingCompany, savedAction, selectedAction, SPLIT_ROUND_DOWN, stepObject, steps, thisOrNumber, tileLaysPerColour, trainManager, trainsBoughtThisTurn
 
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
OperatingRound_1856(GameManagerI gameManager)
           
 
Method Summary
 boolean buyTrain(BuyTrain action)
           
protected  int calculateLoanAmount(int numberOfLoans)
           
protected  int calculateLoanInterest(int numberOfLoans)
           
protected  int checkForDeductions(SetDividend action)
          Default version, to be overridden if need be
protected  int executeDeductions(SetDividend action)
          Default version, to be overridden if need be
protected  boolean finishTurnSpecials()
          Stub, may be overridden in subclasses Return value: TRUE = normal turn end; FALSE = return immediately from finishTurn().
protected  boolean gameSpecificNextStep(GameDef.OrStep step)
          Stub, can be overridden in subclasses to check for extra steps
protected  void prepareRevenueAndDividendAction()
           
protected  void reachDestination(PublicCompanyI company)
          Stub for applying any follow-up actions when a company reaches it destinations.
 void resume(java.util.List<PublicCompanyI> mergingCompanies)
           
protected  void setDestinationActions()
          This is currently a stub, as it is unclear if there is a common rule for setting destination reaching options.
protected  void setGameSpecificPossibleActions()
          Stub, can be overridden by subclasses
protected  boolean setNextOperatingCompany(boolean initial)
          Implements special rules for first time operating in 1856
protected  java.lang.String validateTakeLoans(TakeLoans action)
           
 
Methods inherited from class rails.game.OperatingRound
areTileLaysPossible, buyBonusToken, buyPrivate, canBuyTrainNow, checkForeignSales, checkForExcessTrains, checkNormalTileLay, countSharesPerRecipient, discardTrain, done, equals, executeClosePrivate, executeOperatingCost, executeRepayLoans, executeSetRevenueAndDividend, executeTakeLoans, finishOR, finishTurn, getBeneficiary, getHelp, getNormalTileLays, getOperatingCompanies, getOperatingCompany, getOperatingCompanyIndex, getPrivateMaximumPrice, getPrivateMinimumPrice, getRoundName, getSpecialProperties, getSpecialProperties, getSpecialTileLays, getStep, initNormalTileLays, initTurn, isBelowTrainLimit, isPrivateSellingAllowed, isTileLayAllowed, isTokenLayAllowed, layBaseToken, layBonusToken, layTile, maySellPrivate, newPhaseChecks, nextStep, nextStep, payLoanInterest, payout, prepareNoMapActions, prepareStep, privatesPayOut, process, processGameSpecificAction, reachDestinations, registerNormalTileLay, repayLoans, resume, setBonusTokenLays, setBuyableTrains, setNormalTokenLays, setOperatingCompany, setPossibleActions, setRevenueAndDividend, setSpecialTokenLays, setStep, setTrainsToDiscard, skip, splitRevenue, start, takeLoans, toString, update, updateAllowedTileColours, validateNormalTileLay, validateRepayLoans, validateSetRevenueAndDividend, withhold
 
Methods inherited from class rails.game.Round
canCompanyOperateThisRound, canRequestTurn, certCountsAsSold, checkFlotation, exchangeTokens, finishRound, floatCompany, getAutopasses, getCurrentPhase, getCurrentPlayer, getCurrentPlayerIndex, getGameManager, getGameOption, getGameParameter, getGameParameterAsBoolean, getGameParameterAsInt, getNumberOfActivePlayers, getNumberOfPlayers, getPlayers, getRoundTypeForUI, getSoldPercentage, hasAutopassed, pay, pay, requestTurn, setAutopass, setCanRequestTurn, setCurrentPlayer, setCurrentPlayerIndex, setOperatingCompanies, setOperatingCompanies, transferCertificate, transferCertificates, wasInterrupted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OperatingRound_1856

public OperatingRound_1856(GameManagerI gameManager)
Method Detail

setNextOperatingCompany

protected boolean setNextOperatingCompany(boolean initial)
Implements special rules for first time operating in 1856

Overrides:
setNextOperatingCompany in class OperatingRound

prepareRevenueAndDividendAction

protected void prepareRevenueAndDividendAction()
Overrides:
prepareRevenueAndDividendAction in class OperatingRound

checkForDeductions

protected int checkForDeductions(SetDividend action)
Description copied from class: OperatingRound
Default version, to be overridden if need be

Overrides:
checkForDeductions in class OperatingRound

executeDeductions

protected int executeDeductions(SetDividend action)
Description copied from class: OperatingRound
Default version, to be overridden if need be

Overrides:
executeDeductions in class OperatingRound

setDestinationActions

protected void setDestinationActions()
Description copied from class: OperatingRound
This is currently a stub, as it is unclear if there is a common rule for setting destination reaching options. See OperatingRound_1856 for a first implementation of such rules.

Overrides:
setDestinationActions in class OperatingRound

reachDestination

protected void reachDestination(PublicCompanyI company)
Description copied from class: OperatingRound
Stub for applying any follow-up actions when a company reaches it destinations. Default version: no actions.

Overrides:
reachDestination in class OperatingRound

setGameSpecificPossibleActions

protected void setGameSpecificPossibleActions()
Description copied from class: OperatingRound
Stub, can be overridden by subclasses

Overrides:
setGameSpecificPossibleActions in class OperatingRound

buyTrain

public boolean buyTrain(BuyTrain action)
Overrides:
buyTrain in class OperatingRound

validateTakeLoans

protected java.lang.String validateTakeLoans(TakeLoans action)
Overrides:
validateTakeLoans in class OperatingRound

calculateLoanAmount

protected int calculateLoanAmount(int numberOfLoans)
Overrides:
calculateLoanAmount in class OperatingRound

calculateLoanInterest

protected int calculateLoanInterest(int numberOfLoans)

gameSpecificNextStep

protected boolean gameSpecificNextStep(GameDef.OrStep step)
Description copied from class: OperatingRound
Stub, can be overridden in subclasses to check for extra steps

Overrides:
gameSpecificNextStep in class OperatingRound

resume

public void resume(java.util.List<PublicCompanyI> mergingCompanies)

finishTurnSpecials

protected boolean finishTurnSpecials()
Description copied from class: OperatingRound
Stub, may be overridden in subclasses Return value: TRUE = normal turn end; FALSE = return immediately from finishTurn().

Overrides:
finishTurnSpecials in class OperatingRound