|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjfreerails.move.ChangeTrackPieceMove
public final class ChangeTrackPieceMove
This Move adds, removes, or upgrades the track on a single tile.
| Field Summary | |
|---|---|
private ImPoint |
location
|
private static long |
serialVersionUID
|
private TrackPiece |
trackPieceAfter
|
(package private) TrackPiece |
trackPieceBefore
|
| Constructor Summary | |
|---|---|
ChangeTrackPieceMove(TrackPiece before,
TrackPiece after,
ImPoint p)
|
|
| Method Summary | |
|---|---|
protected static boolean |
canConnect2OtherRRsTrack(ReadOnlyWorld world)
|
protected static MoveStatus |
check4overlap(World w,
ImPoint location,
TrackPiece trackPiece)
This method may be called under 3 possible conditions: (1) when a station is getting built, (2) when a station is getting upgraded, (3) when a staton is getting removed. |
MoveStatus |
doMove(World w,
FreerailsPrincipal p)
Executes this move on the specifed world object. |
boolean |
equals(java.lang.Object o)
|
ImPoint |
getLocation()
|
TrackPiece |
getNewTrackPiece()
|
TrackPiece |
getOldTrackPiece()
|
java.awt.Rectangle |
getUpdatedTiles()
|
int |
hashCode()
|
private void |
move(World w,
TrackPiece oldTrackPiece,
TrackPiece newTrackPiece)
|
private boolean |
noDiagonalTrackConflicts(ImPoint point,
int trackTemplate,
World w)
|
MoveStatus |
tryDoMove(World w,
FreerailsPrincipal p)
Tests whether this Move can be executed on the specifed world object, this method should leave the world object unchanged. |
private MoveStatus |
tryMove(World w,
TrackPiece oldTrackPiece,
TrackPiece newTrackPiece)
|
MoveStatus |
tryUndoMove(World w,
FreerailsPrincipal p)
Tests whether this Move can be undone on the specifed world object, this method should leave the world object unchanged. |
MoveStatus |
undoMove(World w,
FreerailsPrincipal p)
If doMove has just been executed on the specified world
object, calling this method changes the state of the world object back to
how it was before doMove was called. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
final TrackPiece trackPieceBefore
private final TrackPiece trackPieceAfter
private final ImPoint location
| Constructor Detail |
|---|
public ChangeTrackPieceMove(TrackPiece before,
TrackPiece after,
ImPoint p)
| Method Detail |
|---|
public ImPoint getLocation()
public int hashCode()
hashCode in class java.lang.Objectpublic TrackPiece getOldTrackPiece()
public TrackPiece getNewTrackPiece()
public MoveStatus tryDoMove(World w,
FreerailsPrincipal p)
Move
tryDoMove in interface Move
private MoveStatus tryMove(World w,
TrackPiece oldTrackPiece,
TrackPiece newTrackPiece)
public MoveStatus tryUndoMove(World w,
FreerailsPrincipal p)
Move
tryUndoMove in interface Move
public MoveStatus doMove(World w,
FreerailsPrincipal p)
Move
doMove in interface Move
private void move(World w,
TrackPiece oldTrackPiece,
TrackPiece newTrackPiece)
public MoveStatus undoMove(World w,
FreerailsPrincipal p)
MovedoMove has just been executed on the specified world
object, calling this method changes the state of the world object back to
how it was before doMove was called.
undoMove in interface Move
private boolean noDiagonalTrackConflicts(ImPoint point,
int trackTemplate,
World w)
public java.awt.Rectangle getUpdatedTiles()
getUpdatedTiles in interface MapUpdateMovepublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectprotected static boolean canConnect2OtherRRsTrack(ReadOnlyWorld world)
protected static MoveStatus check4overlap(World w,
ImPoint location,
TrackPiece trackPiece)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||