rails.game
Interface TokenHolder

All Superinterfaces:
MoveableHolder
All Known Subinterfaces:
PublicCompanyI
All Known Implementing Classes:
City, Investor_1880, MapHex, Portfolio, PublicCompany, PublicCompany_1825, PublicCompany_1856, PublicCompany_1880, PublicCompany_CGR

public interface TokenHolder
extends MoveableHolder

Interface for implementing a TokenHolder A TokenHolder is any object that can have a token played upon it.


Method Summary
 boolean addToken(TokenI token, int position)
           
 java.lang.String getName()
          Each station must have a name, which includes the tile Id (if on a tile) or the hex name (if on a MapHex).
 java.util.List<TokenI> getTokens()
           
 boolean hasTokens()
          Do we have any tokens?
 boolean removeToken(TokenI token)
          Remove a token.
 
Methods inherited from interface rails.game.move.MoveableHolder
addObject, getListIndex, removeObject
 

Method Detail

addToken

boolean addToken(TokenI token,
                 int position)

removeToken

boolean removeToken(TokenI token)
Remove a token. Subclasses may override this method to implement side effects.

Parameters:
token - The token object to remove.
Returns:
True if successful.

getTokens

java.util.List<TokenI> getTokens()
Returns:
ArrayList of all tokens we have.

hasTokens

boolean hasTokens()
Do we have any tokens?

Returns:
Boolean

getName

java.lang.String getName()
Each station must have a name, which includes the tile Id (if on a tile) or the hex name (if on a MapHex).

Specified by:
getName in interface MoveableHolder
Returns: