jfreerails.controller
Class AddTrainPreMove
java.lang.Object
jfreerails.controller.AddTrainPreMove
- All Implemented Interfaces:
- java.io.Serializable, PreMove, FreerailsSerializable
public class AddTrainPreMove
- extends java.lang.Object
- implements PreMove
- Author:
- Luke
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
engineTypeId
private final int engineTypeId
wagons
private final ImInts wagons
point
private final ImPoint point
principal
private final FreerailsPrincipal principal
schedule
private final ImmutableSchedule schedule
AddTrainPreMove
public AddTrainPreMove(int e,
ImInts wags,
ImPoint p,
FreerailsPrincipal fp,
ImmutableSchedule s)
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
initPositionStep1
PathOnTiles initPositionStep1(ReadOnlyWorld w)
calTrainLength
private int calTrainLength()
initPositionStep2
TrainMotion initPositionStep2(PathOnTiles path)
generateMove
public Move generateMove(ReadOnlyWorld w)
- Generates a move that does the following.
- Adds the train
- Adds a cargo bundle to represent the cargo the train is carrying
- Adds a schedule for the train
- Adds transaction to pay for the train
- Init. the trains position and motion
- Specified by:
generateMove
in interface PreMove