rails.game
Interface StockSpaceI

All Known Implementing Classes:
StockSpace

public interface StockSpaceI


Field Summary
static java.lang.String BELOW_LEDGE_TAG
          The name of the XML tag for the "below ledge" property.
static java.lang.String CLOSES_COMPANY_TAG
          The name of the XML tag for the "closes company" property.
static java.lang.String ELEMENT_ID
          The name of the XML tag used to configure a stock space.
static java.lang.String GAME_OVER_TAG
          The name of the XML tag for the "gamn over" property.
static java.lang.String LEFT_OF_LEDGE_TAG
          The name of the XML tag for the "left of ledge" property.
static java.lang.String NAME_TAG
          The name of the XML attribute for the stock price's name (like "A1" - naming is like spreadsheet cells.
static java.lang.String PRICE_TAG
          The name of the XML attribute for the stock price.
static java.lang.String START_SPACE_TAG
          The name of the XML tag for the "startSpace" property.
static java.lang.String TYPE_TAG
          The name of the XML attribute for the stock price type (optional).
 
Method Summary
 void addFixedStartPrice(PublicCompanyI company)
           
 boolean addToken(PublicCompanyI company)
           
 boolean addTokenAtStackPosition(PublicCompanyI company, int stackPosition)
           
 boolean closesCompany()
           
 boolean endsGame()
           
 java.awt.Color getColour()
           
 int getColumn()
           
 java.util.List<PublicCompanyI> getFixedStartPrices()
           
 java.lang.String getName()
           
 int getPrice()
           
 int getRow()
           
 int getStackPosition(PublicCompanyI company)
          Find the stack position of a company token
 java.util.List<PublicCompanyI> getTokens()
           
 StockSpaceTypeI getType()
           
 boolean hasTokens()
           
 boolean isBelowLedge()
           
 boolean isLeftOfLedge()
           
 boolean isNoBuyLimit()
           
 boolean isNoCertLimit()
           
 boolean isNoHoldLimit()
           
 boolean isStart()
           
 boolean removeToken(PublicCompanyI company)
           
 void setBelowLedge(boolean b)
           
 void setClosesCompany(boolean b)
           
 void setEndsGame(boolean b)
           
 void setLeftOfLedge(boolean b)
           
 void setStart(boolean b)
           
 

Field Detail

ELEMENT_ID

static final java.lang.String ELEMENT_ID
The name of the XML tag used to configure a stock space.

See Also:
Constant Field Values

NAME_TAG

static final java.lang.String NAME_TAG
The name of the XML attribute for the stock price's name (like "A1" - naming is like spreadsheet cells.

See Also:
Constant Field Values

PRICE_TAG

static final java.lang.String PRICE_TAG
The name of the XML attribute for the stock price.

See Also:
Constant Field Values

TYPE_TAG

static final java.lang.String TYPE_TAG
The name of the XML attribute for the stock price type (optional).

See Also:
Constant Field Values

START_SPACE_TAG

static final java.lang.String START_SPACE_TAG
The name of the XML tag for the "startSpace" property. (indicating an allowed PAR price)

See Also:
Constant Field Values

BELOW_LEDGE_TAG

static final java.lang.String BELOW_LEDGE_TAG
The name of the XML tag for the "below ledge" property.

See Also:
Constant Field Values

LEFT_OF_LEDGE_TAG

static final java.lang.String LEFT_OF_LEDGE_TAG
The name of the XML tag for the "left of ledge" property.

See Also:
Constant Field Values

CLOSES_COMPANY_TAG

static final java.lang.String CLOSES_COMPANY_TAG
The name of the XML tag for the "closes company" property.

See Also:
Constant Field Values

GAME_OVER_TAG

static final java.lang.String GAME_OVER_TAG
The name of the XML tag for the "gamn over" property.

See Also:
Constant Field Values
Method Detail

isBelowLedge

boolean isBelowLedge()

closesCompany

boolean closesCompany()
Returns:
TRUE if the square closes companies landing on it.

getColour

java.awt.Color getColour()
Returns:
The square's colour.

endsGame

boolean endsGame()
Returns:
TRUE if the rails.game ends if a company lands on this square.

getPrice

int getPrice()
Returns:
The stock price associated with the square.

getColumn

int getColumn()
Returns:

getName

java.lang.String getName()
Returns:

getRow

int getRow()
Returns:

getType

StockSpaceTypeI getType()
Returns:

isStart

boolean isStart()
Parameters:
b -

setBelowLedge

void setBelowLedge(boolean b)

setClosesCompany

void setClosesCompany(boolean b)
Parameters:
b - See isClosesCompany.

setEndsGame

void setEndsGame(boolean b)
Parameters:
b - See isEndsGame.

setStart

void setStart(boolean b)

getStackPosition

int getStackPosition(PublicCompanyI company)
Find the stack position of a company token

Returns:
Stock position: 0 = top, increasing towards the bottom. -1 if not found.

addFixedStartPrice

void addFixedStartPrice(PublicCompanyI company)

getFixedStartPrices

java.util.List<PublicCompanyI> getFixedStartPrices()

isLeftOfLedge

boolean isLeftOfLedge()
Returns:

setLeftOfLedge

void setLeftOfLedge(boolean b)
Parameters:
b -

isNoBuyLimit

boolean isNoBuyLimit()
Returns:

isNoCertLimit

boolean isNoCertLimit()
Returns:

isNoHoldLimit

boolean isNoHoldLimit()
Returns:

addToken

boolean addToken(PublicCompanyI company)

addTokenAtStackPosition

boolean addTokenAtStackPosition(PublicCompanyI company,
                                int stackPosition)

removeToken

boolean removeToken(PublicCompanyI company)

hasTokens

boolean hasTokens()

getTokens

java.util.List<PublicCompanyI> getTokens()