rails.game
Interface PublicCompanyI

All Superinterfaces:
CashHolder, CompanyI, ConfigurableComponentI, MoveableHolder, TokenHolder
All Known Implementing Classes:
Investor_1880, PublicCompany, PublicCompany_1825, PublicCompany_1856, PublicCompany_1880, PublicCompany_CGR

public interface PublicCompanyI
extends CompanyI, CashHolder, TokenHolder

Interface to be used to access PublicCompany instances.


Field Summary
static int CAPITALISE_FULL
           
static int CAPITALISE_INCREMENTAL
           
static int CAPITALISE_WHEN_BOUGHT
           
 
Fields inherited from interface rails.game.CompanyI
COMPANY_ELEMENT_ID, COMPANY_NAME_TAG, COMPANY_TYPE_TAG
 
Method Summary
 boolean addBonus(Bonus bonus)
           
 void addCertificate(PublicCertificateI certificate)
          Add a certificate to the end of this company's list of certificates.
 void addLoans(int number)
           
 void buyPrivate(PrivateCompanyI privateCompany, Portfolio from, int price)
           
 void buyTrain(TrainI train, int price)
           
 boolean canBuyPrivates()
           
 boolean canBuyStock()
           
 boolean canClose()
           
 boolean canHoldOwnShares()
           
 boolean canLoan()
           
 boolean canRunTrains()
           
 boolean canSharePriceVary()
           
 boolean canUseSpecialProperties()
           
 void checkPresidency()
           
 void checkPresidencyOnBuy(Player buyer)
           
 void checkPresidencyOnSale(Player seller)
           
 int getBaseTokenLayCost(MapHex hex)
           
 int[] getBaseTokenLayCosts()
           
 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.
 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()
           
 java.awt.Color getFgColour()
          Return the company token foreground colour.
 int getFixedPrice()
           
 int getFloatPercentage()
           
 java.lang.String getFormattedCash()
           
 BaseToken getFreeToken()
           
 int getGameEndPrice()
           
 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()
           
 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 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()
           
 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()
           
 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?
 void initTurn()
           
 boolean isBuyable()
           
 boolean isHomeBlockedForAllCities()
           
 boolean isSoldOut()
           
 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)
           
 boolean mayTradeShares()
           
 boolean mustHaveOperatedToTradeShares()
           
 boolean mustOwnATrain()
           
 boolean mustTradeTrainsAtFixedPrice()
           
 void payout(int amount)
           
 boolean paysOutToTreasury(PublicCertificateI cert)
           
 boolean removeBonus(Bonus bonus)
           
 boolean removeBonus(java.lang.String name)
           
 void setBuyable(boolean buyable)
           
 void setCapitalisation(int capitalisation)
           
 void setCertificates(java.util.List<PublicCertificateI> list)
          Assign a predefined array of certificates to 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 homeCityNumber)
           
 void setHomeHex(MapHex homeHex)
           
 void setIndex(int index)
           
 void setLastRevenue(int revenue)
           
 void setLastRevenueAllocation(int allocation)
           
 void setOperated()
           
 void setParSpace(StockSpaceI parPrice)
          Start the company and set its initial (par) price.
 void setReachedDestination(boolean value)
           
 int sharesOwnedByPlayers()
           
 void start()
           
 void start(int price)
           
 void start(StockSpaceI startSpace)
          Start the company.
 void transferAssetsFrom(PublicCompanyI otherCompany)
           
 void updatePlayersWorth()
           
 void withhold(int amount)
           
 
Methods inherited from interface rails.game.CompanyI
clone, equals, getAlias, getCertLimitCount, getCompanyNumber, getInfoText, getLongName, getName, getPortfolio, getSpecialProperties, getType, getTypeName, getValue, hasSpecialProperties, init, isClosed, setCertLimitCount, setClosed, setValue, toString
 
Methods inherited from interface rails.game.ConfigurableComponentI
configureFromXML, finishConfiguration
 
Methods inherited from interface rails.game.CashHolder
addCash, getCashModel, getName
 
Methods inherited from interface rails.game.TokenHolder
addToken, getName, getTokens, hasTokens, removeToken
 
Methods inherited from interface rails.game.move.MoveableHolder
addObject, getListIndex, removeObject
 

Field Detail

CAPITALISE_FULL

static final int CAPITALISE_FULL
See Also:
Constant Field Values

CAPITALISE_INCREMENTAL

static final int CAPITALISE_INCREMENTAL
See Also:
Constant Field Values

CAPITALISE_WHEN_BOUGHT

static final int CAPITALISE_WHEN_BOUGHT
See Also:
Constant Field Values
Method Detail

setIndex

void setIndex(int index)

getBgColour

java.awt.Color getBgColour()
Return the company token background colour.

Returns:
Color object

getHexBgColour

java.lang.String getHexBgColour()
Return the company token background colour.

Returns:
Hexadecimal string RRGGBB.

getFgColour

java.awt.Color getFgColour()
Return the company token foreground colour.

Returns:
Color object.

getHexFgColour

java.lang.String getHexFgColour()
Return the company token foreground colour.

Returns:
Hexadecimal string RRGGBB.

canBuyStock

boolean canBuyStock()
Returns:

canBuyPrivates

boolean canBuyPrivates()
Returns:

canUseSpecialProperties

boolean canUseSpecialProperties()

mustHaveOperatedToTradeShares

boolean mustHaveOperatedToTradeShares()

mayTradeShares

boolean mayTradeShares()

mayBuyTrainType

boolean mayBuyTrainType(TrainI train)

start

void start(StockSpaceI startSpace)
Start the company.


start

void start()

start

void start(int price)

transferAssetsFrom

void transferAssetsFrom(PublicCompanyI otherCompany)

hasStarted

boolean hasStarted()
Returns:
Returns true is the company has started.

setBuyable

void setBuyable(boolean buyable)

isBuyable

boolean isBuyable()

setFloated

void setFloated()
Float the company, put its initial cash in the treasury.


hasFloated

boolean hasFloated()
Has the company already floated?

Returns:
true if the company has floated.

hasOperated

boolean hasOperated()
Has the company already operated?

Returns:
true if the company has operated.

setOperated

void setOperated()

setParSpace

void setParSpace(StockSpaceI parPrice)
Start the company and set its initial (par) price.

Parameters:
spaceI -

getStartSpace

StockSpaceI getStartSpace()
Get the company par (initial) price.

Returns:
StockSpace object, which defines the company start position on the stock chart.

setCurrentSpace

void setCurrentSpace(StockSpaceI price)
Set a new company price.

Parameters:
price - The StockSpace object that defines the new location on the stock market.

getCurrentSpace

StockSpaceI getCurrentSpace()
Get the current company share price.

Returns:
The StockSpace object that defines the current location on the stock market.

getCurrentPriceModel

PriceModel getCurrentPriceModel()

getParPriceModel

PriceModel getParPriceModel()

getFixedPrice

int getFixedPrice()

getIPOPrice

int getIPOPrice()

getMarketPrice

int getMarketPrice()

getGameEndPrice

int getGameEndPrice()

getPublicNumber

int getPublicNumber()

getBaseTokensBuyCost

int getBaseTokensBuyCost()

getBaseTokenLayCost

int getBaseTokenLayCost(MapHex hex)

getBaseTokenLayCosts

int[] getBaseTokenLayCosts()

canHoldOwnShares

boolean canHoldOwnShares()

getCertificates

java.util.List<PublicCertificateI> getCertificates()
Get a list of this company's certificates.

Returns:
ArrayList containing the certificates (item 0 is the President's share).

setCertificates

void setCertificates(java.util.List<PublicCertificateI> list)
Assign a predefined array of certificates to this company.

Parameters:
list - ArrayList containing the certificates.

addCertificate

void addCertificate(PublicCertificateI certificate)
Add a certificate to the end of this company's list of certificates.

Parameters:
certificate - The certificate to add.

getCash

int getCash()
Get the current company treasury.

Note: other cash-related methods are declared in interface CashHolder

Specified by:
getCash in interface CashHolder
Returns:
The current cash amount.

getFormattedCash

java.lang.String getFormattedCash()

setLastRevenue

void setLastRevenue(int revenue)

getLastRevenue

int getLastRevenue()
Get the last revenue earned by this company.

Returns:
The last revenue amount.

getLastRevenueModel

ModelObject getLastRevenueModel()

setLastRevenueAllocation

void setLastRevenueAllocation(int allocation)

getlastRevenueAllocationText

java.lang.String getlastRevenueAllocationText()

getLastRevenueAllocationModel

ModelObject getLastRevenueAllocationModel()

getPresident

Player getPresident()

getPresidentModel

PresidentModel getPresidentModel()

getPresidentsShare

PublicCertificateI getPresidentsShare()

getFloatPercentage

int getFloatPercentage()

payout

void payout(int amount)

withhold

void withhold(int amount)

paysOutToTreasury

boolean paysOutToTreasury(PublicCertificateI cert)

isSoldOut

boolean isSoldOut()

getShareUnit

int getShareUnit()
Get the unit of share.

Returns:
The percentage of ownership that is called "one share".

getShareUnitsForSharePrice

int getShareUnitsForSharePrice()

getNumberOfShares

int getNumberOfShares()

hasStockPrice

boolean hasStockPrice()
Is company present on the Stock Market?

Returns:
True if the company has a stock price.

hasParPrice

boolean hasParPrice()

canSharePriceVary

boolean canSharePriceVary()

updatePlayersWorth

void updatePlayersWorth()

isSplitAllowed

boolean isSplitAllowed()

isSplitAlways

boolean isSplitAlways()

checkPresidencyOnSale

void checkPresidencyOnSale(Player seller)

checkPresidencyOnBuy

void checkPresidencyOnBuy(Player buyer)

checkPresidency

void checkPresidency()

getCapitalisation

int getCapitalisation()

setCapitalisation

void setCapitalisation(int capitalisation)

getTrainLimit

int getTrainLimit(int phaseIndex)

getCurrentTrainLimit

int getCurrentTrainLimit()

getNumberOfTrains

int getNumberOfTrains()

canRunTrains

boolean canRunTrains()

initTurn

void initTurn()

buyTrain

void buyTrain(TrainI train,
              int price)

getTrainsSpentThisTurnModel

ModelObject getTrainsSpentThisTurnModel()

buyPrivate

void buyPrivate(PrivateCompanyI privateCompany,
                Portfolio from,
                int price)

getPrivatesSpentThisTurnModel

ModelObject getPrivatesSpentThisTurnModel()

layTile

void layTile(MapHex hex,
             TileI tile,
             int orientation,
             int cost)

layTileInNoMapMode

void layTileInNoMapMode(int cost)

getTilesLaidThisTurnModel

ModelObject getTilesLaidThisTurnModel()

getTilesCostThisTurnModel

ModelObject getTilesCostThisTurnModel()

layBaseToken

void layBaseToken(MapHex hex,
                  int cost)

layBaseTokenInNoMapMode

void layBaseTokenInNoMapMode(int cost)

getTokensLaidThisTurnModel

ModelObject getTokensLaidThisTurnModel()

getTokensCostThisTurnModel

ModelObject getTokensCostThisTurnModel()

layHomeBaseTokens

boolean layHomeBaseTokens()

hasLaidHomeBaseTokens

boolean hasLaidHomeBaseTokens()

getFreeToken

BaseToken getFreeToken()

getNumberOfBaseTokens

int getNumberOfBaseTokens()

getNumberOfFreeBaseTokens

int getNumberOfFreeBaseTokens()

getNumberOfLaidBaseTokens

int getNumberOfLaidBaseTokens()

getBaseTokensModel

BaseTokensModel getBaseTokensModel()

getBonusTokensModel

BonusModel getBonusTokensModel()

addBonus

boolean addBonus(Bonus bonus)

removeBonus

boolean removeBonus(Bonus bonus)

removeBonus

boolean removeBonus(java.lang.String name)

getBonuses

java.util.List<Bonus> getBonuses()

getHomeHexes

java.util.List<MapHex> getHomeHexes()

setHomeHex

void setHomeHex(MapHex homeHex)

getHomeCityNumber

int getHomeCityNumber()

setHomeCityNumber

void setHomeCityNumber(int homeCityNumber)

isHomeBlockedForAllCities

boolean isHomeBlockedForAllCities()

getDestinationHex

MapHex getDestinationHex()

hasDestination

boolean hasDestination()

hasReachedDestination

boolean hasReachedDestination()

setReachedDestination

void setReachedDestination(boolean value)

getNumberOfTileLays

int getNumberOfTileLays(java.lang.String tileColour)

mustOwnATrain

boolean mustOwnATrain()

mustTradeTrainsAtFixedPrice

boolean mustTradeTrainsAtFixedPrice()

getCurrentNumberOfLoans

int getCurrentNumberOfLoans()

getCurrentLoanValue

int getCurrentLoanValue()

addLoans

void addLoans(int number)

getLoanInterestPct

int getLoanInterestPct()

getMaxNumberOfLoans

int getMaxNumberOfLoans()

canLoan

boolean canLoan()

canClose

boolean canClose()

getMaxLoansPerRound

int getMaxLoansPerRound()

getValuePerLoan

int getValuePerLoan()

getLoanValueModel

MoneyModel getLoanValueModel()

sharesOwnedByPlayers

int sharesOwnedByPlayers()

getExtraShareMarks

java.lang.String getExtraShareMarks()

getInGameModel

ModelObject getInGameModel()

getIsClosedModel

ModelObject getIsClosedModel()