|
||||||||||
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 ConfigurableComponentI
configureFromXML
in class Company
ConfigurationException
public void init(java.lang.String name, CompanyTypeI type)
init
in interface CompanyI
init
in class Company
public void setIndex(int index)
setIndex
in interface PublicCompanyI
public void finishConfiguration(GameManagerI gameManager) throws ConfigurationException
finishConfiguration
in interface ConfigurableComponentI
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.
ConfigurationException
public void initTurn()
initTurn
in interface PublicCompanyI
public java.awt.Color getBgColour()
getBgColour
in interface PublicCompanyI
public java.lang.String getHexBgColour()
getHexBgColour
in interface PublicCompanyI
public java.awt.Color getFgColour()
getFgColour
in interface PublicCompanyI
public java.lang.String getHexFgColour()
getHexFgColour
in interface PublicCompanyI
public java.util.List<MapHex> getHomeHexes()
getHomeHexes
in interface PublicCompanyI
public void setHomeHex(MapHex homeHex)
setHomeHex
in interface PublicCompanyI
homeHex
- The homeHex to set.public int getHomeCityNumber()
getHomeCityNumber
in interface PublicCompanyI
public void setHomeCityNumber(int number)
setHomeCityNumber
in interface PublicCompanyI
homeStation
- The homeStation to set.public boolean isHomeBlockedForAllCities()
isHomeBlockedForAllCities
in interface PublicCompanyI
public MapHex getDestinationHex()
getDestinationHex
in interface PublicCompanyI
public boolean hasDestination()
hasDestination
in interface PublicCompanyI
public boolean hasReachedDestination()
hasReachedDestination
in interface PublicCompanyI
public void setReachedDestination(boolean value)
setReachedDestination
in interface PublicCompanyI
public boolean canBuyStock()
canBuyStock
in interface PublicCompanyI
public boolean mayTradeShares()
mayTradeShares
in interface PublicCompanyI
public boolean mayBuyTrainType(TrainI train)
mayBuyTrainType
in interface PublicCompanyI
public boolean mustHaveOperatedToTradeShares()
mustHaveOperatedToTradeShares
in interface PublicCompanyI
public void start(StockSpaceI startSpace)
PublicCompanyI
start
in interface PublicCompanyI
public void start(int price)
start
in interface PublicCompanyI
public void start()
start
in interface PublicCompanyI
public void transferAssetsFrom(PublicCompanyI otherCompany)
transferAssetsFrom
in interface PublicCompanyI
public boolean hasStarted()
hasStarted
in interface PublicCompanyI
public void setBuyable(boolean buyable)
setBuyable
in interface PublicCompanyI
public boolean isBuyable()
isBuyable
in interface PublicCompanyI
public void setFloated()
setFloated
in interface PublicCompanyI
public boolean hasFloated()
hasFloated
in interface PublicCompanyI
public boolean hasOperated()
hasOperated
in interface PublicCompanyI
public void setOperated()
setOperated
in interface PublicCompanyI
public void setClosed()
Company
setClosed
in interface CompanyI
setClosed
in class Company
protected void reinitialise()
public ModelObject getInGameModel()
getInGameModel
in interface PublicCompanyI
public ModelObject getIsClosedModel()
getIsClosedModel
in interface PublicCompanyI
public void setParSpace(StockSpaceI space)
Note: this method should not be
used to start a company! Use start()
in
stead.
setParSpace
in interface PublicCompanyI
spaceI
- public StockSpaceI getStartSpace()
getStartSpace
in interface PublicCompanyI
public int getIPOPrice()
getIPOPrice
in interface PublicCompanyI
public int getMarketPrice()
getMarketPrice
in interface PublicCompanyI
public int getGameEndPrice()
getGameEndPrice
in interface PublicCompanyI
public void setCurrentSpace(StockSpaceI price)
setCurrentSpace
in interface PublicCompanyI
price
- The StockSpace object that defines the new location on the
stock market.public PriceModel getCurrentPriceModel()
getCurrentPriceModel
in interface PublicCompanyI
public PriceModel getParPriceModel()
getParPriceModel
in interface PublicCompanyI
public StockSpaceI getCurrentSpace()
getCurrentSpace
in interface PublicCompanyI
public void updatePlayersWorth()
updatePlayersWorth
in interface PublicCompanyI
public void addCash(int amount)
addCash
in interface CashHolder
amount
- The amount to add (may be negative).public int getCash()
getCash
in interface CashHolder
getCash
in interface PublicCompanyI
public java.lang.String getFormattedCash()
getFormattedCash
in interface PublicCompanyI
public ModelObject getCashModel()
getCashModel
in interface CashHolder
public int getPublicNumber()
getPublicNumber
in interface PublicCompanyI
public java.util.List<PublicCertificateI> getCertificates()
getCertificates
in interface PublicCompanyI
public void setCertificates(java.util.List<PublicCertificateI> list)
setCertificates
in interface PublicCompanyI
list
- ArrayList containing the certificates.public void nameCertificates()
public void addCertificate(PublicCertificateI certificate)
addCertificate
in interface PublicCompanyI
certificate
- The certificate to add.public int getFloatPercentage()
getFloatPercentage
in interface PublicCompanyI
public Player getPresident()
getPresident
in interface PublicCompanyI
public PresidentModel getPresidentModel()
getPresidentModel
in interface PublicCompanyI
public PublicCertificateI getPresidentsShare()
getPresidentsShare
in interface PublicCompanyI
public boolean isAvailable()
public void setLastRevenue(int i)
setLastRevenue
in interface PublicCompanyI
i
- The last revenue amount.public int getLastRevenue()
getLastRevenue
in interface PublicCompanyI
public ModelObject getLastRevenueModel()
getLastRevenueModel
in interface PublicCompanyI
public void setLastRevenueAllocation(int allocation)
setLastRevenueAllocation
in interface PublicCompanyI
public java.lang.String getlastRevenueAllocationText()
getlastRevenueAllocationText
in interface PublicCompanyI
public ModelObject getLastRevenueAllocationModel()
getLastRevenueAllocationModel
in interface PublicCompanyI
public void payout(int amount)
payout
in interface PublicCompanyI
amount
- public boolean paysOutToTreasury(PublicCertificateI cert)
paysOutToTreasury
in interface PublicCompanyI
public void withhold(int amount)
withhold
in interface PublicCompanyI
The
- revenue amount.public boolean isSoldOut()
isSoldOut
in interface PublicCompanyI
public boolean canBuyPrivates()
canBuyPrivates
in interface PublicCompanyI
public boolean canUseSpecialProperties()
canUseSpecialProperties
in interface PublicCompanyI
public int getShareUnit()
getShareUnit
in interface PublicCompanyI
public int getShareUnitsForSharePrice()
getShareUnitsForSharePrice
in interface PublicCompanyI
public java.lang.String toString()
toString
in interface CompanyI
toString
in class Company
public boolean hasStockPrice()
PublicCompanyI
hasStockPrice
in interface PublicCompanyI
public boolean hasParPrice()
hasParPrice
in interface PublicCompanyI
public boolean canSharePriceVary()
canSharePriceVary
in interface PublicCompanyI
public int getFixedPrice()
getFixedPrice
in interface PublicCompanyI
public int getBaseTokensBuyCost()
getBaseTokensBuyCost
in interface PublicCompanyI
public int sharesOwnedByPlayers()
sharesOwnedByPlayers
in interface PublicCompanyI
public boolean canHoldOwnShares()
canHoldOwnShares
in interface PublicCompanyI
public boolean isSplitAllowed()
isSplitAllowed
in interface PublicCompanyI
public boolean isSplitAlways()
isSplitAlways
in interface PublicCompanyI
public void checkPresidencyOnBuy(Player buyer)
checkPresidencyOnBuy
in interface PublicCompanyI
buyer
- Player who has just bought a certificate.public void checkPresidencyOnSale(Player seller)
checkPresidencyOnSale
in interface PublicCompanyI
public void checkPresidency()
checkPresidency
in interface PublicCompanyI
public int getCapitalisation()
getCapitalisation
in interface PublicCompanyI
public void setCapitalisation(int capitalisation)
setCapitalisation
in interface PublicCompanyI
capitalisation
- The capitalisation to set.public int getNumberOfShares()
getNumberOfShares
in interface PublicCompanyI
public int getTrainLimit(int phaseIndex)
getTrainLimit
in interface PublicCompanyI
public int getCurrentTrainLimit()
getCurrentTrainLimit
in interface PublicCompanyI
public int getNumberOfTrains()
getNumberOfTrains
in interface PublicCompanyI
public boolean canRunTrains()
canRunTrains
in interface PublicCompanyI
public void buyTrain(TrainI train, int price)
buyTrain
in interface PublicCompanyI
public ModelObject getTrainsSpentThisTurnModel()
getTrainsSpentThisTurnModel
in interface PublicCompanyI
public void buyPrivate(PrivateCompanyI privateCompany, Portfolio from, int price)
buyPrivate
in interface PublicCompanyI
public ModelObject getPrivatesSpentThisTurnModel()
getPrivatesSpentThisTurnModel
in interface PublicCompanyI
public void layTile(MapHex hex, TileI tile, int orientation, int cost)
layTile
in interface PublicCompanyI
public void layTileInNoMapMode(int cost)
layTileInNoMapMode
in interface PublicCompanyI
public ModelObject getTilesLaidThisTurnModel()
getTilesLaidThisTurnModel
in interface PublicCompanyI
public ModelObject getTilesCostThisTurnModel()
getTilesCostThisTurnModel
in interface PublicCompanyI
public void layBaseToken(MapHex hex, int cost)
layBaseToken
in interface PublicCompanyI
public void layBaseTokenInNoMapMode(int cost)
layBaseTokenInNoMapMode
in interface PublicCompanyI
public int getBaseTokenLayCost(MapHex hex)
getBaseTokenLayCost
in interface PublicCompanyI
hex
- The hex where the token is to be laid.
public int[] getBaseTokenLayCosts()
getBaseTokenLayCosts
in interface PublicCompanyI
public ModelObject getTokensLaidThisTurnModel()
getTokensLaidThisTurnModel
in interface PublicCompanyI
public ModelObject getTokensCostThisTurnModel()
getTokensCostThisTurnModel
in interface PublicCompanyI
public BaseTokensModel getBaseTokensModel()
getBaseTokensModel
in interface PublicCompanyI
public boolean addBonus(Bonus bonus)
addBonus
in interface PublicCompanyI
public boolean removeBonus(Bonus bonus)
removeBonus
in interface PublicCompanyI
public boolean removeBonus(java.lang.String name)
removeBonus
in interface PublicCompanyI
public java.util.List<Bonus> getBonuses()
getBonuses
in interface PublicCompanyI
public BonusModel getBonusTokensModel()
getBonusTokensModel
in interface PublicCompanyI
public boolean hasLaidHomeBaseTokens()
hasLaidHomeBaseTokens
in interface PublicCompanyI
public boolean layHomeBaseTokens()
layHomeBaseTokens
in interface PublicCompanyI
public BaseToken getFreeToken()
getFreeToken
in interface PublicCompanyI
public boolean addToken(TokenI token, int position)
addToken
in interface TokenHolder
public java.util.List<TokenI> getTokens()
getTokens
in interface TokenHolder
public int getNumberOfBaseTokens()
getNumberOfBaseTokens
in interface PublicCompanyI
public int getNumberOfFreeBaseTokens()
getNumberOfFreeBaseTokens
in interface PublicCompanyI
public int getNumberOfLaidBaseTokens()
getNumberOfLaidBaseTokens
in interface PublicCompanyI
public boolean hasTokens()
TokenHolder
hasTokens
in interface TokenHolder
public boolean removeToken(TokenI token)
removeToken
in interface TokenHolder
token
- The token object to remove.
public boolean addObject(Moveable object, int[] position)
MoveableHolder
addObject
in interface MoveableHolder
object
- 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 MoveableHolder
public int[] getListIndex(Moveable object)
getListIndex
in interface MoveableHolder
public int getNumberOfTileLays(java.lang.String tileColour)
getNumberOfTileLays
in interface PublicCompanyI
public boolean mustOwnATrain()
mustOwnATrain
in interface PublicCompanyI
public boolean mustTradeTrainsAtFixedPrice()
mustTradeTrainsAtFixedPrice
in interface PublicCompanyI
public int getCurrentNumberOfLoans()
getCurrentNumberOfLoans
in interface PublicCompanyI
public int getCurrentLoanValue()
getCurrentLoanValue
in interface PublicCompanyI
public void addLoans(int number)
addLoans
in interface PublicCompanyI
public int getLoanInterestPct()
getLoanInterestPct
in interface PublicCompanyI
public int getMaxNumberOfLoans()
getMaxNumberOfLoans
in interface PublicCompanyI
public boolean canLoan()
canLoan
in interface PublicCompanyI
public int getMaxLoansPerRound()
getMaxLoansPerRound
in interface PublicCompanyI
public int getValuePerLoan()
getValuePerLoan
in interface PublicCompanyI
public MoneyModel getLoanValueModel()
getLoanValueModel
in interface PublicCompanyI
public boolean canClose()
canClose
in interface PublicCompanyI
public java.lang.Object clone()
clone
in interface CompanyI
clone
in class Company
public java.lang.String getExtraShareMarks()
getExtraShareMarks
in interface PublicCompanyI
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |