rails.game.specific._1856
Class PublicCompany_CGR

java.lang.Object
  extended by rails.game.Company
      extended by rails.game.PublicCompany
          extended by rails.game.specific._1856.PublicCompany_CGR
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable<Company>, RevenueStaticModifier, CashHolder, CompanyI, ConfigurableComponentI, MoveableHolder, PublicCompanyI, TokenHolder

public class PublicCompany_CGR
extends PublicCompany
implements RevenueStaticModifier


Field Summary
static java.lang.String NAME
           
 
Fields inherited from class rails.game.PublicCompany
allBaseTokens, bank, BASE_COST_DISTANCE, BASE_COST_SEQUENCE, baseTokenLayCost, baseTokenLayCostMethod, baseTokensBuyCost, baseTokensModel, bgColour, bgHexColour, bonuses, bonusValue, buyable, canBeRestarted, canBuyPrivates, canBuyStock, canClose, canHoldOwnShares, canSharePriceVary, canUseSpecialProperties, capitalisation, certificates, currentLoanValue, currentNumberOfLoans, currentPrice, DEFAULT_SHARE_UNIT, destinationHex, destinationHexName, extraTileLays, extraTiles, fgColour, fgHexColour, fixedPrice, floatPerc, freeBaseTokens, gameManager, hasFloated, hasOperated, hasParPrice, hasReachedDestination, hasStarted, hasStockPrice, homeAllCitiesBlocked, homeBaseTokensLayTime, homeCityNumber, homeHexes, homeHexNames, inGameState, initialTrainCost, initialTrainTradeable, initialTrainType, ipoPaysOut, laidBaseTokens, lastRevenue, lastRevenueAllocation, loanInterestPct, lowerPrivatePriceFactor, mapManager, maxLoansPerRound, maxNumberOfLoans, maxPercOfOwnShares, mayTradeShares, mustHaveOperatedToTradeShares, mustOwnATrain, mustTradeTrainsAtFixedPrice, numberOfBaseTokens, numberOfPublicCompanies, parPrice, payoutMustExceedPriceToMove, poolPaysOut, presidentModel, privatesCostThisTurn, privateToCloseOnFirstTrain, privateToCloseOnFirstTrainName, publicNumber, sharePriceUpOnFloating, shareUnit, shareUnitsForSharePrice, splitAllowed, splitAlways, START_OF_FIRST_OR, startSpace, stockMarket, tilesCostThisTurn, tilesLaidThisTurn, tokenLayTimeNames, tokensCostThisTurn, tokensLaidThisTurn, trainLimit, trainsCostThisTurn, treasury, treasuryPaysOut, turnsWithExtraTileLays, turnsWithExtraTileLaysInit, upperPrivatePriceFactor, valuePerLoan, WHEN_FLOATED, WHEN_STARTED
 
Fields inherited from class rails.game.Company
alias, certLimitCount, closedObject, companyNumber, infoText, log, longName, name, parentInfoText, portfolio, specialProperties, type, value
 
Fields inherited from interface rails.game.PublicCompanyI
CAPITALISE_FULL, CAPITALISE_INCREMENTAL, CAPITALISE_WHEN_BOUGHT
 
Fields inherited from interface rails.game.CompanyI
COMPANY_ELEMENT_ID, COMPANY_NAME_TAG, COMPANY_TYPE_TAG
 
Constructor Summary
PublicCompany_CGR()
           
 
Method Summary
 void buyTrain(TrainI train, int price)
          Must be called in stead of Portfolio.buyTrain if side-effects can occur.
 boolean canRunTrains()
           
 void finishConfiguration(GameManagerI gameManager)
          Final initialisation, after all XML has been processed.
 java.lang.String getExtraShareMarks()
          Extra codes to be added to the president's indicator in the Game Status window.
 Player getPresident()
          Get the company President.
 Player getTemporaryPresident()
           
 boolean hadPermanentTrain()
           
 boolean hasTemporaryPresident()
           
 void init(java.lang.String name, CompanyTypeI type)
          Initialisation, to be called directly after instantiation (cloning)
 boolean mayBuyTrainType(TrainI train)
          Stub that allows exclusions such as that 1856 CGR may not buy a 4
 void modifyCalculator(RevenueAdapter revenueAdapter)
           
 boolean mustOwnATrain()
           
 boolean runsWithBorrowedTrain()
           
 void setHadPermanentTrain(boolean hadPermanentTrain)
           
 void setShareUnit(int percentage)
           
 void setTemporaryPresident(Player temporaryPresident)
           
 void withhold(int amount)
          CGR share price does not move until a permanent train is bought.
 
Methods inherited from class rails.game.PublicCompany
addBonus, addCash, addCertificate, addLoans, addObject, addToken, buyPrivate, canBuyPrivates, canBuyStock, canClose, canHoldOwnShares, canLoan, canSharePriceVary, canUseSpecialProperties, checkPresidency, checkPresidencyOnBuy, checkPresidencyOnSale, clone, configureFromXML, getBaseTokenLayCost, getBaseTokenLayCosts, getBaseTokensBuyCost, getBaseTokensModel, getBgColour, getBonuses, getBonusTokensModel, getCapitalisation, getCash, getCashModel, getCertificates, getCurrentLoanValue, getCurrentNumberOfLoans, getCurrentPriceModel, getCurrentSpace, getCurrentTrainLimit, getDestinationHex, getFgColour, getFixedPrice, getFloatPercentage, getFormattedCash, getFreeToken, getGameEndPrice, getHexBgColour, getHexFgColour, getHomeCityNumber, getHomeHexes, getInGameModel, getIPOPrice, getIsClosedModel, getLastRevenue, getLastRevenueAllocationModel, getlastRevenueAllocationText, getLastRevenueModel, getListIndex, getLoanInterestPct, getLoanValueModel, getMarketPrice, getMaxLoansPerRound, getMaxNumberOfLoans, getNumberOfBaseTokens, getNumberOfFreeBaseTokens, getNumberOfLaidBaseTokens, getNumberOfShares, getNumberOfTileLays, getNumberOfTrains, getParPriceModel, getPresidentModel, getPresidentsShare, getPrivatesSpentThisTurnModel, getPublicNumber, getShareUnit, getShareUnitsForSharePrice, getStartSpace, getTilesCostThisTurnModel, getTilesLaidThisTurnModel, getTokens, getTokensCostThisTurnModel, getTokensLaidThisTurnModel, getTrainLimit, getTrainsSpentThisTurnModel, getValuePerLoan, hasDestination, hasFloated, hasLaidHomeBaseTokens, hasOperated, hasParPrice, hasReachedDestination, hasStarted, hasStockPrice, hasTokens, initTurn, isAvailable, isBuyable, isHomeBlockedForAllCities, isSoldOut, isSplitAllowed, isSplitAlways, layBaseToken, layBaseTokenInNoMapMode, layHomeBaseTokens, layTile, layTileInNoMapMode, mayTradeShares, mustHaveOperatedToTradeShares, mustTradeTrainsAtFixedPrice, nameCertificates, payout, paysOutToTreasury, reinitialise, removeBonus, removeBonus, removeObject, removeToken, setBuyable, setCapitalisation, setCertificates, setClosed, setCurrentSpace, setFloated, setHomeCityNumber, setHomeHex, setIndex, setLastRevenue, setLastRevenueAllocation, setOperated, setParSpace, setReachedDestination, sharesOwnedByPlayers, start, start, start, toString, transferAssetsFrom, updatePlayersWorth
 
Methods inherited from class rails.game.Company
addToken, compareTo, equals, getAlias, getCertLimitCount, getCompanyNumber, getHolder, getInfoText, getLongName, getName, getNumber, getPortfolio, getSpecialProperties, getType, getTypeName, getValue, hasSpecialProperties, isClosed, joinNamesWithDelimiter, setCertLimitCount, setValue
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface rails.game.CompanyI
equals, getAlias, getCertLimitCount, getCompanyNumber, getInfoText, getLongName, getName, getPortfolio, getSpecialProperties, getType, getTypeName, getValue, hasSpecialProperties, isClosed, setCertLimitCount, setValue
 
Methods inherited from interface rails.game.CashHolder
getName
 
Methods inherited from interface rails.game.TokenHolder
getName
 

Field Detail

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values
Constructor Detail

PublicCompany_CGR

public PublicCompany_CGR()
Method Detail

init

public void init(java.lang.String name,
                 CompanyTypeI type)
Initialisation, to be called directly after instantiation (cloning)

Specified by:
init in interface CompanyI
Overrides:
init in class PublicCompany

finishConfiguration

public void finishConfiguration(GameManagerI gameManager)
                         throws ConfigurationException
Description copied from class: PublicCompany
Final initialisation, after all XML has been processed.

Specified by:
finishConfiguration in interface ConfigurableComponentI
Overrides:
finishConfiguration in class PublicCompany
Parameters:
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.
Throws:
ConfigurationException

hadPermanentTrain

public boolean hadPermanentTrain()

setHadPermanentTrain

public void setHadPermanentTrain(boolean hadPermanentTrain)

hasTemporaryPresident

public boolean hasTemporaryPresident()

getTemporaryPresident

public Player getTemporaryPresident()

mayBuyTrainType

public boolean mayBuyTrainType(TrainI train)
Description copied from class: PublicCompany
Stub that allows exclusions such as that 1856 CGR may not buy a 4

Specified by:
mayBuyTrainType in interface PublicCompanyI
Overrides:
mayBuyTrainType in class PublicCompany

getPresident

public Player getPresident()
Description copied from class: PublicCompany
Get the company President.

Specified by:
getPresident in interface PublicCompanyI
Overrides:
getPresident in class PublicCompany

setTemporaryPresident

public void setTemporaryPresident(Player temporaryPresident)

canRunTrains

public boolean canRunTrains()
Specified by:
canRunTrains in interface PublicCompanyI
Overrides:
canRunTrains in class PublicCompany

runsWithBorrowedTrain

public boolean runsWithBorrowedTrain()

withhold

public void withhold(int amount)
CGR share price does not move until a permanent train is bought.

Specified by:
withhold in interface PublicCompanyI
Overrides:
withhold in class PublicCompany
Parameters:
The - revenue amount.

buyTrain

public void buyTrain(TrainI train,
                     int price)
Description copied from class: PublicCompany
Must be called in stead of Portfolio.buyTrain if side-effects can occur.

Specified by:
buyTrain in interface PublicCompanyI
Overrides:
buyTrain in class PublicCompany

setShareUnit

public void setShareUnit(int percentage)

mustOwnATrain

public boolean mustOwnATrain()
Specified by:
mustOwnATrain in interface PublicCompanyI
Overrides:
mustOwnATrain in class PublicCompany

getExtraShareMarks

public java.lang.String getExtraShareMarks()
Description copied from class: PublicCompany
Extra codes to be added to the president's indicator in the Game Status window. Normally nothing (see 1856 CGR for an exception).

Specified by:
getExtraShareMarks in interface PublicCompanyI
Overrides:
getExtraShareMarks in class PublicCompany

modifyCalculator

public void modifyCalculator(RevenueAdapter revenueAdapter)
Specified by:
modifyCalculator in interface RevenueStaticModifier