|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrails.game.Company
rails.game.PublicCompany
public class PublicCompany
This class provides an implementation of a (perhaps only basic) public company. Public companies encompass all 18xx company-like entities that lay tracks and run trains.
Ownership of companies will always be performed by holding certificates. Some minor company types may have only one certificate, but this will still be the form in which ownership is expressed.
Company shares may or may not have a price on the stock market.
| Field Summary | |
|---|---|
protected java.util.List<TokenI> |
allBaseTokens
|
protected Bank |
bank
|
static java.lang.String |
BASE_COST_DISTANCE
|
static java.lang.String |
BASE_COST_SEQUENCE
|
protected int[] |
baseTokenLayCost
An array of base token laying costs, per successive token |
protected java.lang.String |
baseTokenLayCostMethod
|
protected int |
baseTokensBuyCost
|
protected BaseTokensModel |
baseTokensModel
|
protected java.awt.Color |
bgColour
Background colour of the company tokens |
protected java.lang.String |
bgHexColour
Hexadecimal representation (RRGGBB) of the background colour. |
protected java.util.List<Bonus> |
bonuses
Acquires Bonus objects |
protected BonusModel |
bonusValue
Total bonus tokens amount |
protected BooleanState |
buyable
Are company shares buyable (i.e. |
protected boolean |
canBeRestarted
Can a company be restarted once it is closed? |
protected boolean |
canBuyPrivates
|
protected boolean |
canBuyStock
|
protected boolean |
canClose
Can the company price token go down to a "Close" square? 1856 CGR cannot. |
protected boolean |
canHoldOwnShares
|
protected BooleanState |
canSharePriceVary
|
protected boolean |
canUseSpecialProperties
|
protected int |
capitalisation
|
protected java.util.ArrayList<PublicCertificateI> |
certificates
The certificates of this company (minimum 1) |
(package private) boolean |
certsAreInitiallyAvailable
Are the certificates available from the first SR? |
protected MoneyModel |
currentLoanValue
|
protected IntegerState |
currentNumberOfLoans
|
protected PriceModel |
currentPrice
Current share price, represented by a stock market location object |
protected static int |
DEFAULT_SHARE_UNIT
|
protected MapHex |
destinationHex
|
protected java.lang.String |
destinationHexName
Destination hex * |
protected java.util.Map<java.lang.String,java.util.HashMap<java.lang.String,java.lang.Integer>> |
extraTileLays
A map per tile colour. |
protected IntegerState |
extraTiles
Number of tiles laid. |
protected java.awt.Color |
fgColour
Foreground (i.e. |
protected java.lang.String |
fgHexColour
Hexadecimal representation (RRGGBB) of the foreground colour. |
protected int |
fixedPrice
Fixed price (for a 1835-style minor) |
protected int |
floatPerc
At what percentage sold does the company float |
protected java.util.List<TokenI> |
freeBaseTokens
|
protected GameManagerI |
gameManager
|
protected BooleanState |
hasFloated
Is the company operational ("has it floated")? |
protected BooleanState |
hasOperated
Has the company already operated? |
protected boolean |
hasParPrice
Does the company have a par price? |
protected BooleanState |
hasReachedDestination
|
protected BooleanState |
hasStarted
Has the company started? |
protected boolean |
hasStockPrice
Does the company have a stock price (minors often don't) |
protected boolean |
homeAllCitiesBlocked
|
protected int |
homeBaseTokensLayTime
|
protected int |
homeCityNumber
|
protected java.util.List<MapHex> |
homeHexes
|
protected java.lang.String |
homeHexNames
Home hex & city * Two home hexes is supported, but only if: 1. |
protected BooleanState |
inGameState
In-game state. |
protected int |
initialTrainCost
|
protected boolean |
initialTrainTradeable
|
protected java.lang.String |
initialTrainType
Initial train at floating time |
protected boolean |
ipoPaysOut
|
protected java.util.List<TokenI> |
laidBaseTokens
|
protected MoneyModel |
lastRevenue
Most recent revenue earned. |
protected StringState |
lastRevenueAllocation
Most recent payout decision. |
protected int |
loanInterestPct
|
protected float |
lowerPrivatePriceFactor
Minimum price for buying privates, to be multiplied by the original price |
protected MapManager |
mapManager
|
protected int |
maxLoansPerRound
|
protected int |
maxNumberOfLoans
|
protected int |
maxPercOfOwnShares
|
protected boolean |
mayTradeShares
|
protected boolean |
mustHaveOperatedToTradeShares
|
protected boolean |
mustOwnATrain
Must the company own a train |
protected boolean |
mustTradeTrainsAtFixedPrice
|
protected int |
numberOfBaseTokens
|
protected static int |
numberOfPublicCompanies
|
protected PriceModel |
parPrice
Initial (par) share price, represented by a stock market location object |
protected boolean |
payoutMustExceedPriceToMove
Must payout exceed stock price to move token right? |
protected boolean |
poolPaysOut
|
protected PresidentModel |
presidentModel
PresidentModel |
protected MoneyModel |
privatesCostThisTurn
|
protected PrivateCompanyI |
privateToCloseOnFirstTrain
|
protected java.lang.String |
privateToCloseOnFirstTrainName
Private to close if first train is bought |
protected int |
publicNumber
Sequence number in the array of public companies - may not be useful |
protected boolean |
sharePriceUpOnFloating
Share price movement on floating (1851: up) |
protected IntegerState |
shareUnit
What percentage of ownership constitutes "one share" |
protected int |
shareUnitsForSharePrice
What number of share units relates to the share price (normally 1, but 2 for 1835 Prussian) |
protected boolean |
splitAllowed
|
protected boolean |
splitAlways
Is the revenue always split (typical for non-share minors) |
protected static int |
START_OF_FIRST_OR
|
protected java.lang.String |
startSpace
|
protected StockMarketI |
stockMarket
|
protected MoneyModel |
tilesCostThisTurn
|
protected StringState |
tilesLaidThisTurn
|
protected static java.lang.String[] |
tokenLayTimeNames
|
protected MoneyModel |
tokensCostThisTurn
|
protected StringState |
tokensLaidThisTurn
|
protected int[] |
trainLimit
Train limit per phase (index) |
protected MoneyModel |
trainsCostThisTurn
|
protected CashModel |
treasury
Company treasury, holding cash |
protected boolean |
treasuryPaysOut
|
protected java.util.Map<java.lang.String,IntegerState> |
turnsWithExtraTileLays
Copy of turnsWithExtraTileLaysInit, per company |
protected java.util.Map<java.lang.String,java.lang.Integer> |
turnsWithExtraTileLaysInit
A map per tile colour, holding the number of turns that the tile lay number applies. |
protected float |
upperPrivatePriceFactor
Maximum price for buying privates, to be multiplied by the original price |
protected int |
valuePerLoan
|
protected static int |
WHEN_FLOATED
|
protected static int |
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()
The constructor. |
|
| Method Summary | |
|---|---|
boolean |
addBonus(Bonus bonus)
|
void |
addCash(int amount)
Add a given amount to the company treasury. |
void |
addCertificate(PublicCertificateI certificate)
Add a certificate to the end of this company's list of certificates. |
void |
addLoans(int number)
|
boolean |
addObject(Moveable object,
int[] position)
Add an object to its list at a certain position. |
boolean |
addToken(TokenI token,
int position)
Add a base token to the company charter. |
void |
buyPrivate(PrivateCompanyI privateCompany,
Portfolio from,
int price)
|
void |
buyTrain(TrainI train,
int price)
Must be called in stead of Portfolio.buyTrain if side-effects can occur. |
boolean |
canBuyPrivates()
|
boolean |
canBuyStock()
|
boolean |
canClose()
|
boolean |
canHoldOwnShares()
|
boolean |
canLoan()
|
boolean |
canRunTrains()
|
boolean |
canSharePriceVary()
|
boolean |
canUseSpecialProperties()
|
void |
checkPresidency()
A generic presidency check. |
void |
checkPresidencyOnBuy(Player buyer)
Check if the presidency has changed for a buying player. |
void |
checkPresidencyOnSale(Player seller)
Check if the presidency has changed for a selling player. |
java.lang.Object |
clone()
|
void |
configureFromXML(Tag tag)
To configure all public companies from the <PublicCompany> XML element |
void |
finishConfiguration(GameManagerI gameManager)
Final initialisation, after all XML has been processed. |
int |
getBaseTokenLayCost(MapHex hex)
Calculate the cost of laying a token, given the hex where the token is laid. |
int[] |
getBaseTokenLayCosts()
Return all possible token lay costs to be incurred for the company's next token lay. |
int |
getBaseTokensBuyCost()
|
BaseTokensModel |
getBaseTokensModel()
|
java.awt.Color |
getBgColour()
Return the company token background colour. |
java.util.List<Bonus> |
getBonuses()
|
BonusModel |
getBonusTokensModel()
|
int |
getCapitalisation()
|
int |
getCash()
Get the current company treasury. |
ModelObject |
getCashModel()
|
java.util.List<PublicCertificateI> |
getCertificates()
Get a list of this company's certificates. |
int |
getCurrentLoanValue()
|
int |
getCurrentNumberOfLoans()
|
PriceModel |
getCurrentPriceModel()
|
StockSpaceI |
getCurrentSpace()
Get the current company share price. |
int |
getCurrentTrainLimit()
|
MapHex |
getDestinationHex()
|
java.lang.String |
getExtraShareMarks()
Extra codes to be added to the president's indicator in the Game Status window. |
java.awt.Color |
getFgColour()
Return the company token foreground colour. |
int |
getFixedPrice()
|
int |
getFloatPercentage()
Get the percentage of shares that must be sold to float the company. |
java.lang.String |
getFormattedCash()
|
BaseToken |
getFreeToken()
|
int |
getGameEndPrice()
Return the price per share at game end. |
java.lang.String |
getHexBgColour()
Return the company token background colour. |
java.lang.String |
getHexFgColour()
Return the company token foreground colour. |
int |
getHomeCityNumber()
|
java.util.List<MapHex> |
getHomeHexes()
Return the company's Home hexes (usually one). |
ModelObject |
getInGameModel()
|
int |
getIPOPrice()
|
ModelObject |
getIsClosedModel()
|
int |
getLastRevenue()
Get the last revenue earned by this company. |
ModelObject |
getLastRevenueAllocationModel()
|
java.lang.String |
getlastRevenueAllocationText()
|
ModelObject |
getLastRevenueModel()
|
int[] |
getListIndex(Moveable object)
|
int |
getLoanInterestPct()
|
MoneyModel |
getLoanValueModel()
|
int |
getMarketPrice()
|
int |
getMaxLoansPerRound()
|
int |
getMaxNumberOfLoans()
|
int |
getNumberOfBaseTokens()
|
int |
getNumberOfFreeBaseTokens()
|
int |
getNumberOfLaidBaseTokens()
|
int |
getNumberOfShares()
|
int |
getNumberOfTileLays(java.lang.String tileColour)
|
int |
getNumberOfTrains()
|
PriceModel |
getParPriceModel()
|
Player |
getPresident()
Get the company President. |
PresidentModel |
getPresidentModel()
|
PublicCertificateI |
getPresidentsShare()
|
ModelObject |
getPrivatesSpentThisTurnModel()
|
int |
getPublicNumber()
|
int |
getShareUnit()
Get the unit of share. |
int |
getShareUnitsForSharePrice()
|
StockSpaceI |
getStartSpace()
Get the company par (initial) price. |
ModelObject |
getTilesCostThisTurnModel()
|
ModelObject |
getTilesLaidThisTurnModel()
|
java.util.List<TokenI> |
getTokens()
|
ModelObject |
getTokensCostThisTurnModel()
|
ModelObject |
getTokensLaidThisTurnModel()
|
int |
getTrainLimit(int phaseIndex)
|
ModelObject |
getTrainsSpentThisTurnModel()
|
int |
getValuePerLoan()
|
boolean |
hasDestination()
|
boolean |
hasFloated()
Has the company already floated? |
boolean |
hasLaidHomeBaseTokens()
|
boolean |
hasOperated()
Has the company already operated? |
boolean |
hasParPrice()
|
boolean |
hasReachedDestination()
|
boolean |
hasStarted()
|
boolean |
hasStockPrice()
Is company present on the Stock Market? |
boolean |
hasTokens()
Do we have any tokens? |
void |
init(java.lang.String name,
CompanyTypeI type)
Initialisation, to be called directly after instantiation (cloning) |
void |
initTurn()
Reset turn objects |
boolean |
isAvailable()
|
boolean |
isBuyable()
|
boolean |
isHomeBlockedForAllCities()
|
boolean |
isSoldOut()
Is the company completely sold out? This method should return true only if the share price should move up at the end of a stock round. |
boolean |
isSplitAllowed()
|
boolean |
isSplitAlways()
|
void |
layBaseToken(MapHex hex,
int cost)
|
void |
layBaseTokenInNoMapMode(int cost)
|
boolean |
layHomeBaseTokens()
|
void |
layTile(MapHex hex,
TileI tile,
int orientation,
int cost)
|
void |
layTileInNoMapMode(int cost)
|
boolean |
mayBuyTrainType(TrainI train)
Stub that allows exclusions such as that 1856 CGR may not buy a 4 |
boolean |
mayTradeShares()
|
boolean |
mustHaveOperatedToTradeShares()
|
boolean |
mustOwnATrain()
|
boolean |
mustTradeTrainsAtFixedPrice()
|
void |
nameCertificates()
Backlink the certificates to this company, and give each one a type name. |
void |
payout(int amount)
Determine if the price token must be moved after a dividend payout. |
boolean |
paysOutToTreasury(PublicCertificateI cert)
|
protected void |
reinitialise()
Reinitialise a company, i.e. |
boolean |
removeBonus(Bonus bonus)
|
boolean |
removeBonus(java.lang.String name)
|
boolean |
removeObject(Moveable object)
|
boolean |
removeToken(TokenI token)
Remove a base token from the company charter. |
void |
setBuyable(boolean buyable)
Make company shares buyable. |
void |
setCapitalisation(int capitalisation)
|
void |
setCertificates(java.util.List<PublicCertificateI> list)
Assign a predefined list of certificates to this company. |
void |
setClosed()
Close this company. |
void |
setCurrentSpace(StockSpaceI price)
Set a new company price. |
void |
setFloated()
Float the company, put its initial cash in the treasury. |
void |
setHomeCityNumber(int number)
|
void |
setHomeHex(MapHex homeHex)
Set a non-fixed company home hex. |
void |
setIndex(int index)
|
void |
setLastRevenue(int i)
Store the last revenue earned by this company. |
void |
setLastRevenueAllocation(int allocation)
Last revenue allocation (payout, split, withhold) |
void |
setOperated()
|
void |
setParSpace(StockSpaceI space)
Set the company par price. |
void |
setReachedDestination(boolean value)
|
int |
sharesOwnedByPlayers()
|
void |
start()
Start a company. |
void |
start(int price)
|
void |
start(StockSpaceI startSpace)
Start the company. |
java.lang.String |
toString()
|
void |
transferAssetsFrom(PublicCompanyI otherCompany)
|
void |
updatePlayersWorth()
|
void |
withhold(int amount)
Determine if the price token must be moved after a withheld dividend. |
| 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 |
|---|
protected static final int DEFAULT_SHARE_UNIT
protected static int numberOfPublicCompanies
protected static final int WHEN_STARTED
protected static final int WHEN_FLOATED
protected static final int START_OF_FIRST_OR
public static final java.lang.String BASE_COST_SEQUENCE
public static final java.lang.String BASE_COST_DISTANCE
protected static final java.lang.String[] tokenLayTimeNames
protected int homeBaseTokensLayTime
protected java.awt.Color fgColour
protected java.lang.String fgHexColour
protected java.awt.Color bgColour
protected java.lang.String bgHexColour
protected java.lang.String homeHexNames
protected java.util.List<MapHex> homeHexes
protected int homeCityNumber
protected boolean homeAllCitiesBlocked
protected java.lang.String destinationHexName
protected MapHex destinationHex
protected BooleanState hasReachedDestination
protected int publicNumber
protected java.util.List<TokenI> allBaseTokens
protected java.util.List<TokenI> freeBaseTokens
protected java.util.List<TokenI> laidBaseTokens
protected int numberOfBaseTokens
protected int baseTokensBuyCost
protected int[] baseTokenLayCost
protected java.lang.String baseTokenLayCostMethod
protected BaseTokensModel baseTokensModel
protected PriceModel parPrice
protected PriceModel currentPrice
protected CashModel treasury
protected PresidentModel presidentModel
protected BooleanState hasStarted
protected BonusModel bonusValue
protected java.util.List<Bonus> bonuses
protected MoneyModel lastRevenue
protected StringState lastRevenueAllocation
protected BooleanState hasFloated
protected BooleanState hasOperated
protected BooleanState buyable
protected BooleanState inGameState
Will only be set false if the company is closed and cannot ever be reopened. By default it will be set false if a company is closed.
protected java.util.Map<java.lang.String,java.util.HashMap<java.lang.String,java.lang.Integer>> extraTileLays
protected java.util.Map<java.lang.String,java.lang.Integer> turnsWithExtraTileLaysInit
protected java.util.Map<java.lang.String,IntegerState> turnsWithExtraTileLays
protected IntegerState extraTiles
protected MoneyModel privatesCostThisTurn
protected StringState tilesLaidThisTurn
protected MoneyModel tilesCostThisTurn
protected StringState tokensLaidThisTurn
protected MoneyModel tokensCostThisTurn
protected MoneyModel trainsCostThisTurn
protected boolean canBuyStock
protected boolean canBuyPrivates
protected boolean canUseSpecialProperties
protected boolean canBeRestarted
protected float lowerPrivatePriceFactor
protected float upperPrivatePriceFactor
protected boolean ipoPaysOut
protected boolean poolPaysOut
protected boolean treasuryPaysOut
protected boolean canHoldOwnShares
protected int maxPercOfOwnShares
protected boolean mayTradeShares
protected boolean mustHaveOperatedToTradeShares
protected java.util.ArrayList<PublicCertificateI> certificates
boolean certsAreInitiallyAvailable
protected IntegerState shareUnit
protected int shareUnitsForSharePrice
protected int floatPerc
protected boolean sharePriceUpOnFloating
protected boolean hasStockPrice
protected boolean hasParPrice
protected boolean splitAllowed
protected boolean splitAlways
protected boolean payoutMustExceedPriceToMove
protected java.lang.String startSpace
protected int capitalisation
protected int fixedPrice
protected int[] trainLimit
protected java.lang.String privateToCloseOnFirstTrainName
protected PrivateCompanyI privateToCloseOnFirstTrain
protected boolean mustOwnATrain
protected boolean mustTradeTrainsAtFixedPrice
protected boolean canClose
protected java.lang.String initialTrainType
protected int initialTrainCost
protected boolean initialTrainTradeable
protected int maxNumberOfLoans
protected int valuePerLoan
protected IntegerState currentNumberOfLoans
protected int loanInterestPct
protected int maxLoansPerRound
protected MoneyModel currentLoanValue
protected BooleanState canSharePriceVary
protected GameManagerI gameManager
protected Bank bank
protected StockMarketI stockMarket
protected MapManager mapManager
| Constructor Detail |
|---|
public PublicCompany()
| Method Detail |
|---|
public void configureFromXML(Tag tag)
throws ConfigurationException
configureFromXML in interface ConfigurableComponentIconfigureFromXML in class CompanyConfigurationException
public void init(java.lang.String name,
CompanyTypeI type)
init in interface CompanyIinit in class Companypublic void setIndex(int index)
setIndex in interface PublicCompanyI
public void finishConfiguration(GameManagerI gameManager)
throws ConfigurationException
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.
ConfigurationExceptionpublic void initTurn()
initTurn in interface PublicCompanyIpublic java.awt.Color getBgColour()
getBgColour in interface PublicCompanyIpublic java.lang.String getHexBgColour()
getHexBgColour in interface PublicCompanyIpublic java.awt.Color getFgColour()
getFgColour in interface PublicCompanyIpublic java.lang.String getHexFgColour()
getHexFgColour in interface PublicCompanyIpublic java.util.List<MapHex> getHomeHexes()
getHomeHexes in interface PublicCompanyIpublic void setHomeHex(MapHex homeHex)
setHomeHex in interface PublicCompanyIhomeHex - The homeHex to set.public int getHomeCityNumber()
getHomeCityNumber in interface PublicCompanyIpublic void setHomeCityNumber(int number)
setHomeCityNumber in interface PublicCompanyIhomeStation - The homeStation to set.public boolean isHomeBlockedForAllCities()
isHomeBlockedForAllCities in interface PublicCompanyIpublic MapHex getDestinationHex()
getDestinationHex in interface PublicCompanyIpublic boolean hasDestination()
hasDestination in interface PublicCompanyIpublic boolean hasReachedDestination()
hasReachedDestination in interface PublicCompanyIpublic void setReachedDestination(boolean value)
setReachedDestination in interface PublicCompanyIpublic boolean canBuyStock()
canBuyStock in interface PublicCompanyIpublic boolean mayTradeShares()
mayTradeShares in interface PublicCompanyIpublic boolean mayBuyTrainType(TrainI train)
mayBuyTrainType in interface PublicCompanyIpublic boolean mustHaveOperatedToTradeShares()
mustHaveOperatedToTradeShares in interface PublicCompanyIpublic void start(StockSpaceI startSpace)
PublicCompanyI
start in interface PublicCompanyIpublic void start(int price)
start in interface PublicCompanyIpublic void start()
start in interface PublicCompanyIpublic void transferAssetsFrom(PublicCompanyI otherCompany)
transferAssetsFrom in interface PublicCompanyIpublic boolean hasStarted()
hasStarted in interface PublicCompanyIpublic void setBuyable(boolean buyable)
setBuyable in interface PublicCompanyIpublic boolean isBuyable()
isBuyable in interface PublicCompanyIpublic void setFloated()
setFloated in interface PublicCompanyIpublic boolean hasFloated()
hasFloated in interface PublicCompanyIpublic boolean hasOperated()
hasOperated in interface PublicCompanyIpublic void setOperated()
setOperated in interface PublicCompanyIpublic void setClosed()
Company
setClosed in interface CompanyIsetClosed in class Companyprotected void reinitialise()
public ModelObject getInGameModel()
getInGameModel in interface PublicCompanyIpublic ModelObject getIsClosedModel()
getIsClosedModel in interface PublicCompanyIpublic void setParSpace(StockSpaceI space)
Note: this method should not be
used to start a company! Use start() in
stead.
setParSpace in interface PublicCompanyIspaceI - public StockSpaceI getStartSpace()
getStartSpace in interface PublicCompanyIpublic int getIPOPrice()
getIPOPrice in interface PublicCompanyIpublic int getMarketPrice()
getMarketPrice in interface PublicCompanyIpublic int getGameEndPrice()
getGameEndPrice in interface PublicCompanyIpublic void setCurrentSpace(StockSpaceI price)
setCurrentSpace in interface PublicCompanyIprice - The StockSpace object that defines the new location on the
stock market.public PriceModel getCurrentPriceModel()
getCurrentPriceModel in interface PublicCompanyIpublic PriceModel getParPriceModel()
getParPriceModel in interface PublicCompanyIpublic StockSpaceI getCurrentSpace()
getCurrentSpace in interface PublicCompanyIpublic void updatePlayersWorth()
updatePlayersWorth in interface PublicCompanyIpublic void addCash(int amount)
addCash in interface CashHolderamount - The amount to add (may be negative).public int getCash()
getCash in interface CashHoldergetCash in interface PublicCompanyIpublic java.lang.String getFormattedCash()
getFormattedCash in interface PublicCompanyIpublic ModelObject getCashModel()
getCashModel in interface CashHolderpublic int getPublicNumber()
getPublicNumber in interface PublicCompanyIpublic java.util.List<PublicCertificateI> getCertificates()
getCertificates in interface PublicCompanyIpublic void setCertificates(java.util.List<PublicCertificateI> list)
setCertificates in interface PublicCompanyIlist - ArrayList containing the certificates.public void nameCertificates()
public void addCertificate(PublicCertificateI certificate)
addCertificate in interface PublicCompanyIcertificate - The certificate to add.public int getFloatPercentage()
getFloatPercentage in interface PublicCompanyIpublic Player getPresident()
getPresident in interface PublicCompanyIpublic PresidentModel getPresidentModel()
getPresidentModel in interface PublicCompanyIpublic PublicCertificateI getPresidentsShare()
getPresidentsShare in interface PublicCompanyIpublic boolean isAvailable()
public void setLastRevenue(int i)
setLastRevenue in interface PublicCompanyIi - The last revenue amount.public int getLastRevenue()
getLastRevenue in interface PublicCompanyIpublic ModelObject getLastRevenueModel()
getLastRevenueModel in interface PublicCompanyIpublic void setLastRevenueAllocation(int allocation)
setLastRevenueAllocation in interface PublicCompanyIpublic java.lang.String getlastRevenueAllocationText()
getlastRevenueAllocationText in interface PublicCompanyIpublic ModelObject getLastRevenueAllocationModel()
getLastRevenueAllocationModel in interface PublicCompanyIpublic void payout(int amount)
payout in interface PublicCompanyIamount - public boolean paysOutToTreasury(PublicCertificateI cert)
paysOutToTreasury in interface PublicCompanyIpublic void withhold(int amount)
withhold in interface PublicCompanyIThe - revenue amount.public boolean isSoldOut()
isSoldOut in interface PublicCompanyIpublic boolean canBuyPrivates()
canBuyPrivates in interface PublicCompanyIpublic boolean canUseSpecialProperties()
canUseSpecialProperties in interface PublicCompanyIpublic int getShareUnit()
getShareUnit in interface PublicCompanyIpublic int getShareUnitsForSharePrice()
getShareUnitsForSharePrice in interface PublicCompanyIpublic java.lang.String toString()
toString in interface CompanyItoString in class Companypublic boolean hasStockPrice()
PublicCompanyI
hasStockPrice in interface PublicCompanyIpublic boolean hasParPrice()
hasParPrice in interface PublicCompanyIpublic boolean canSharePriceVary()
canSharePriceVary in interface PublicCompanyIpublic int getFixedPrice()
getFixedPrice in interface PublicCompanyIpublic int getBaseTokensBuyCost()
getBaseTokensBuyCost in interface PublicCompanyIpublic int sharesOwnedByPlayers()
sharesOwnedByPlayers in interface PublicCompanyIpublic boolean canHoldOwnShares()
canHoldOwnShares in interface PublicCompanyIpublic boolean isSplitAllowed()
isSplitAllowed in interface PublicCompanyIpublic boolean isSplitAlways()
isSplitAlways in interface PublicCompanyIpublic void checkPresidencyOnBuy(Player buyer)
checkPresidencyOnBuy in interface PublicCompanyIbuyer - Player who has just bought a certificate.public void checkPresidencyOnSale(Player seller)
checkPresidencyOnSale in interface PublicCompanyIpublic void checkPresidency()
checkPresidency in interface PublicCompanyIpublic int getCapitalisation()
getCapitalisation in interface PublicCompanyIpublic void setCapitalisation(int capitalisation)
setCapitalisation in interface PublicCompanyIcapitalisation - The capitalisation to set.public int getNumberOfShares()
getNumberOfShares in interface PublicCompanyIpublic int getTrainLimit(int phaseIndex)
getTrainLimit in interface PublicCompanyIpublic int getCurrentTrainLimit()
getCurrentTrainLimit in interface PublicCompanyIpublic int getNumberOfTrains()
getNumberOfTrains in interface PublicCompanyIpublic boolean canRunTrains()
canRunTrains in interface PublicCompanyI
public void buyTrain(TrainI train,
int price)
buyTrain in interface PublicCompanyIpublic ModelObject getTrainsSpentThisTurnModel()
getTrainsSpentThisTurnModel in interface PublicCompanyI
public void buyPrivate(PrivateCompanyI privateCompany,
Portfolio from,
int price)
buyPrivate in interface PublicCompanyIpublic ModelObject getPrivatesSpentThisTurnModel()
getPrivatesSpentThisTurnModel in interface PublicCompanyI
public void layTile(MapHex hex,
TileI tile,
int orientation,
int cost)
layTile in interface PublicCompanyIpublic void layTileInNoMapMode(int cost)
layTileInNoMapMode in interface PublicCompanyIpublic ModelObject getTilesLaidThisTurnModel()
getTilesLaidThisTurnModel in interface PublicCompanyIpublic ModelObject getTilesCostThisTurnModel()
getTilesCostThisTurnModel in interface PublicCompanyI
public void layBaseToken(MapHex hex,
int cost)
layBaseToken in interface PublicCompanyIpublic void layBaseTokenInNoMapMode(int cost)
layBaseTokenInNoMapMode in interface PublicCompanyIpublic int getBaseTokenLayCost(MapHex hex)
getBaseTokenLayCost in interface PublicCompanyIhex - The hex where the token is to be laid.
public int[] getBaseTokenLayCosts()
getBaseTokenLayCosts in interface PublicCompanyIpublic ModelObject getTokensLaidThisTurnModel()
getTokensLaidThisTurnModel in interface PublicCompanyIpublic ModelObject getTokensCostThisTurnModel()
getTokensCostThisTurnModel in interface PublicCompanyIpublic BaseTokensModel getBaseTokensModel()
getBaseTokensModel in interface PublicCompanyIpublic boolean addBonus(Bonus bonus)
addBonus in interface PublicCompanyIpublic boolean removeBonus(Bonus bonus)
removeBonus in interface PublicCompanyIpublic boolean removeBonus(java.lang.String name)
removeBonus in interface PublicCompanyIpublic java.util.List<Bonus> getBonuses()
getBonuses in interface PublicCompanyIpublic BonusModel getBonusTokensModel()
getBonusTokensModel in interface PublicCompanyIpublic boolean hasLaidHomeBaseTokens()
hasLaidHomeBaseTokens in interface PublicCompanyIpublic boolean layHomeBaseTokens()
layHomeBaseTokens in interface PublicCompanyIpublic BaseToken getFreeToken()
getFreeToken in interface PublicCompanyI
public boolean addToken(TokenI token,
int position)
addToken in interface TokenHolderpublic java.util.List<TokenI> getTokens()
getTokens in interface TokenHolderpublic int getNumberOfBaseTokens()
getNumberOfBaseTokens in interface PublicCompanyIpublic int getNumberOfFreeBaseTokens()
getNumberOfFreeBaseTokens in interface PublicCompanyIpublic int getNumberOfLaidBaseTokens()
getNumberOfLaidBaseTokens in interface PublicCompanyIpublic boolean hasTokens()
TokenHolder
hasTokens in interface TokenHolderpublic boolean removeToken(TokenI token)
removeToken in interface TokenHoldertoken - The token object to remove.
public boolean addObject(Moveable object,
int[] position)
MoveableHolder
addObject in interface MoveableHolderobject - The Moveable object to be added.position - Position to insert object at. O: at front, -1, at end, >0: at that position.
public boolean removeObject(Moveable object)
removeObject in interface MoveableHolderpublic int[] getListIndex(Moveable object)
getListIndex in interface MoveableHolderpublic int getNumberOfTileLays(java.lang.String tileColour)
getNumberOfTileLays in interface PublicCompanyIpublic boolean mustOwnATrain()
mustOwnATrain in interface PublicCompanyIpublic boolean mustTradeTrainsAtFixedPrice()
mustTradeTrainsAtFixedPrice in interface PublicCompanyIpublic int getCurrentNumberOfLoans()
getCurrentNumberOfLoans in interface PublicCompanyIpublic int getCurrentLoanValue()
getCurrentLoanValue in interface PublicCompanyIpublic void addLoans(int number)
addLoans in interface PublicCompanyIpublic int getLoanInterestPct()
getLoanInterestPct in interface PublicCompanyIpublic int getMaxNumberOfLoans()
getMaxNumberOfLoans in interface PublicCompanyIpublic boolean canLoan()
canLoan in interface PublicCompanyIpublic int getMaxLoansPerRound()
getMaxLoansPerRound in interface PublicCompanyIpublic int getValuePerLoan()
getValuePerLoan in interface PublicCompanyIpublic MoneyModel getLoanValueModel()
getLoanValueModel in interface PublicCompanyIpublic boolean canClose()
canClose in interface PublicCompanyIpublic java.lang.Object clone()
clone in interface CompanyIclone in class Companypublic java.lang.String getExtraShareMarks()
getExtraShareMarks in interface PublicCompanyI
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||