jfreerails.world.track
Class LegalTrackPlacement

java.lang.Object
  extended by jfreerails.world.track.LegalTrackPlacement
All Implemented Interfaces:
java.io.Serializable, FreerailsSerializable

public final class LegalTrackPlacement
extends java.lang.Object
implements FreerailsSerializable

This class encapsulates the rules governing where, that is, on what terrain, track of a given type can be built.

Author:
lindsal
See Also:
Serialized Form

Nested Class Summary
static class LegalTrackPlacement.PlacementRule
           
 
Field Summary
private  LegalTrackPlacement.PlacementRule placementRule
           
private static long serialVersionUID
           
private  ImHashSet<TerrainType.Category> terrainTypes
           
 
Constructor Summary
LegalTrackPlacement(java.util.HashSet<TerrainType.Category> types, LegalTrackPlacement.PlacementRule placementRule)
           
 
Method Summary
 boolean canBuildOnThisTerrain(TerrainType.Category terrainType)
           
 boolean equals(java.lang.Object o)
           
 LegalTrackPlacement.PlacementRule getPlacementRule()
           
 int hashCode()
           
 
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

terrainTypes

private final ImHashSet<TerrainType.Category> terrainTypes

placementRule

private final LegalTrackPlacement.PlacementRule placementRule
Constructor Detail

LegalTrackPlacement

public LegalTrackPlacement(java.util.HashSet<TerrainType.Category> types,
                           LegalTrackPlacement.PlacementRule placementRule)
Method Detail

hashCode

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

canBuildOnThisTerrain

public boolean canBuildOnThisTerrain(TerrainType.Category terrainType)

equals

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

getPlacementRule

public LegalTrackPlacement.PlacementRule getPlacementRule()