rails.game
Class Station

java.lang.Object
  extended by rails.game.Station

public class Station
extends java.lang.Object

A Station object represents any junction on a tile, where one, two or more track fragments meet. The usual Station types are "City", "Town" and "OffMapCity". Other types found in some games are "Pass" (1841), "Port" (1841, 18EU) and "Halt" (1860).

The station types "City" and "OffMapCity" may have slots for placing tokens.

Station objects are used in Tile objects, to represent the station(s) on a tile. Each tile type is represented by just one Tile object (which is NOT cloned or newly instantiated when a Tile is laid). Please note, that all preprinted tiles on the map are also represented by Tile objects, so laying the first tile on a hex is treated as a normal upgrade in this program.

See also the City class, which represents stations on tiles that have actually been laid on a MapHex.

Author:
Erik Vos

Field Summary
static java.lang.String CITY
           
static java.lang.String HALT
           
static java.lang.String JUNCTION
           
protected static org.apache.log4j.Logger log
           
static java.lang.String OFF_MAP_AREA
           
static java.lang.String PASS
           
static java.lang.String PORT
           
static java.lang.String TOWN
           
 
Constructor Summary
Station(TileI tile, int number, java.lang.String id, java.lang.String type, int value, int slots, int position, java.lang.String cityName)
           
 
Method Summary
 int getBaseSlots()
           
 java.lang.String getCityName()
           
 java.lang.String getId()
           
 java.lang.String getName()
           
 int getNumber()
           
 int getPosition()
           
 java.lang.Object getTile()
           
 java.lang.String getType()
           
 int getValue()
           
 int getX()
           
 int getY()
           
static boolean isTypeValid(java.lang.String type)
          Check validity of a Station type
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CITY

public static final java.lang.String CITY
See Also:
Constant Field Values

TOWN

public static final java.lang.String TOWN
See Also:
Constant Field Values

HALT

public static final java.lang.String HALT
See Also:
Constant Field Values

OFF_MAP_AREA

public static final java.lang.String OFF_MAP_AREA
See Also:
Constant Field Values

PORT

public static final java.lang.String PORT
See Also:
Constant Field Values

PASS

public static final java.lang.String PASS
See Also:
Constant Field Values

JUNCTION

public static final java.lang.String JUNCTION
See Also:
Constant Field Values

log

protected static org.apache.log4j.Logger log
Constructor Detail

Station

public Station(TileI tile,
               int number,
               java.lang.String id,
               java.lang.String type,
               int value,
               int slots,
               int position,
               java.lang.String cityName)
Method Detail

isTypeValid

public static boolean isTypeValid(java.lang.String type)
Check validity of a Station type


getName

public java.lang.String getName()

getCityName

public java.lang.String getCityName()

getTile

public java.lang.Object getTile()
Returns:
Returns the holder.

getId

public java.lang.String getId()
Returns:
Returns the id.

getNumber

public int getNumber()

getType

public java.lang.String getType()
Returns:
Returns the type.

getBaseSlots

public int getBaseSlots()
Returns:
Returns the baseSlots.

getValue

public int getValue()
Returns:
Returns the value.

getPosition

public int getPosition()

getX

public int getX()

getY

public int getY()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object