jfreerails.world.track
Class NullTrackType

java.lang.Object
  extended by jfreerails.world.track.NullTrackType
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<TrackRule>, FreerailsSerializable, TrackRule

public final class NullTrackType
extends java.lang.Object
implements TrackRule

The type of a Null track piece. TODO maybe it would be simplier to get rid of this and jsut check against null!

Author:
lindsal
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface jfreerails.world.track.TrackRule
TrackRule.TrackCategories
 
Field Summary
static int NULL_TRACK_TYPE_RULE_NUMBER
           
private static NullTrackType nullTrackType
           
private static long serialVersionUID
           
 
Constructor Summary
private NullTrackType()
           
 
Method Summary
 boolean canBuildOnThisTerrainType(TerrainType.Category TerrainType)
           
 int compareTo(TrackRule arg0)
           
 boolean equals(java.lang.Object o)
           
 TrackRule.TrackCategories getCategory()
           
 Money getFixedCost()
           
static NullTrackType getInstance()
           
 java.util.Iterator<TrackConfiguration> getLegalConfigurationsIterator()
           
 Step[] getLegalRoutes(Step directionComingFrom)
           
 Money getMaintenanceCost()
           
 int getMaximumConsecutivePieces()
           
 Money getPrice()
           
 int getStationRadius()
           
 TrackPiece getTrackPiece(TrackConfiguration config, int owner)
           
 java.lang.String getTypeName()
           
 int hashCode()
           
 boolean isDouble()
           
 boolean isStation()
           
private  java.lang.Object readResolve()
           
 boolean testTrackPieceLegality(int trackTemplateToTest)
           
 boolean trackPieceIsLegal(TrackConfiguration config)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

NULL_TRACK_TYPE_RULE_NUMBER

public static final int NULL_TRACK_TYPE_RULE_NUMBER
See Also:
Constant Field Values

nullTrackType

private static final NullTrackType nullTrackType
Constructor Detail

NullTrackType

private NullTrackType()
Method Detail

readResolve

private java.lang.Object readResolve()
                              throws java.io.ObjectStreamException
Throws:
java.io.ObjectStreamException

getInstance

public static NullTrackType getInstance()

canBuildOnThisTerrainType

public boolean canBuildOnThisTerrainType(TerrainType.Category TerrainType)
Specified by:
canBuildOnThisTerrainType in interface TrackRule

getLegalRoutes

public Step[] getLegalRoutes(Step directionComingFrom)
Specified by:
getLegalRoutes in interface TrackRule

getMaximumConsecutivePieces

public int getMaximumConsecutivePieces()
Specified by:
getMaximumConsecutivePieces in interface TrackRule

getTypeName

public java.lang.String getTypeName()
Specified by:
getTypeName in interface TrackRule

testTrackPieceLegality

public boolean testTrackPieceLegality(int trackTemplateToTest)
Specified by:
testTrackPieceLegality in interface TrackRule

trackPieceIsLegal

public boolean trackPieceIsLegal(TrackConfiguration config)
Specified by:
trackPieceIsLegal in interface TrackRule

getLegalConfigurationsIterator

public java.util.Iterator<TrackConfiguration> getLegalConfigurationsIterator()
Specified by:
getLegalConfigurationsIterator in interface TrackRule

getTrackPiece

public TrackPiece getTrackPiece(TrackConfiguration config,
                                int owner)

isStation

public boolean isStation()
Specified by:
isStation in interface TrackRule

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getStationRadius

public int getStationRadius()
Specified by:
getStationRadius in interface TrackRule

getPrice

public Money getPrice()
Specified by:
getPrice in interface TrackRule

getMaintenanceCost

public Money getMaintenanceCost()
Specified by:
getMaintenanceCost in interface TrackRule

getCategory

public TrackRule.TrackCategories getCategory()
Specified by:
getCategory in interface TrackRule

compareTo

public int compareTo(TrackRule arg0)
Specified by:
compareTo in interface java.lang.Comparable<TrackRule>

isDouble

public boolean isDouble()
Specified by:
isDouble in interface TrackRule

getFixedCost

public Money getFixedCost()
Specified by:
getFixedCost in interface TrackRule