jfreerails.controller
Class AddStationPreMove

java.lang.Object
  extended by jfreerails.controller.AddStationPreMove
All Implemented Interfaces:
java.io.Serializable, PreMove, FreerailsSerializable

public class AddStationPreMove
extends java.lang.Object
implements PreMove

Generates a move that adds or upgrades a station.

Author:
Luke
See Also:
Serialized Form

Field Summary
private  ImPoint p
           
private  FreerailsPrincipal principal
           
private  int ruleNumber
           
private static long serialVersionUID
           
 
Constructor Summary
private AddStationPreMove(ImPoint p, int trackRule, FreerailsPrincipal principal)
           
 
Method Summary
private  CompositeMove addSupplyAndDemand(CompositeMove m, ReadOnlyWorld w)
           
 boolean equals(java.lang.Object o)
           
 Move generateMove(ReadOnlyWorld world)
           
 int hashCode()
           
static AddStationPreMove newStation(ImPoint p, int trackRule, FreerailsPrincipal principal)
           
static AddStationPreMove upgradeStation(ImPoint p, int trackRule, FreerailsPrincipal principal)
           
 
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

p

private final ImPoint p

ruleNumber

private final int ruleNumber

principal

private final FreerailsPrincipal principal
Constructor Detail

AddStationPreMove

private AddStationPreMove(ImPoint p,
                          int trackRule,
                          FreerailsPrincipal principal)
Method Detail

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

newStation

public static AddStationPreMove newStation(ImPoint p,
                                           int trackRule,
                                           FreerailsPrincipal principal)

upgradeStation

public static AddStationPreMove upgradeStation(ImPoint p,
                                               int trackRule,
                                               FreerailsPrincipal principal)

generateMove

public Move generateMove(ReadOnlyWorld world)
Specified by:
generateMove in interface PreMove

addSupplyAndDemand

private CompositeMove addSupplyAndDemand(CompositeMove m,
                                         ReadOnlyWorld w)