Package net.sf.freecol.common.networking
Class ChangeSet.MoveChange
- java.lang.Object
-
- net.sf.freecol.common.networking.ChangeSet.Change<AnimateMoveMessage>
-
- net.sf.freecol.common.networking.ChangeSet.MoveChange
-
- Enclosing class:
- ChangeSet
private static class ChangeSet.MoveChange extends ChangeSet.Change<AnimateMoveMessage>
Encapsulate a move.
-
-
Field Summary
Fields Modifier and Type Field Description private TilenewTileprivate LocationoldLocationprivate Unitunit-
Fields inherited from class net.sf.freecol.common.networking.ChangeSet.Change
see
-
-
Constructor Summary
Constructors Constructor Description MoveChange(ChangeSet.See see, Unit unit, Location oldLocation, Tile newTile)Build a new MoveChange.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChangeSet.Changeconsequence(Player player)Are the secondary changes consequent to this Change?booleanisNotifiable(Player player)Should a player be notified of this Change? Override in subclasses with special cases.private booleanseeNew(Player player)Can a player see the new tile?private booleanseeOld(Player player)Can a player see the old tile?AnimateMoveMessagetoMessage(Player player)Specialize a Change for a particular player.java.lang.StringtoString()-
Methods inherited from class net.sf.freecol.common.networking.ChangeSet.Change
check, matches
-
-
-
-
Constructor Detail
-
MoveChange
public MoveChange(ChangeSet.See see, Unit unit, Location oldLocation, Tile newTile)
Build a new MoveChange.- Parameters:
see- The visibility of this change.unit- TheUnitthat is moving.oldLocation- The location from which the unit is moving.newTile- TheTileto which the unit is moving.
-
-
Method Detail
-
seeOld
private boolean seeOld(Player player)
Can a player see the old tile?- Parameters:
player- ThePlayerto test.- Returns:
- True if the old tile is visible.
-
seeNew
private boolean seeNew(Player player)
Can a player see the new tile?- Parameters:
player- ThePlayerto test.- Returns:
- True if the new tile is visible.
-
isNotifiable
public boolean isNotifiable(Player player)
Should a player be notified of this Change? Override in subclasses with special cases.- Overrides:
isNotifiablein classChangeSet.Change<AnimateMoveMessage>- Parameters:
player- ThePlayerto consider.- Returns:
- True if this
Changeshould be sent.
-
consequence
public ChangeSet.Change consequence(Player player)
Are the secondary changes consequent to this Change?- Overrides:
consequencein classChangeSet.Change<AnimateMoveMessage>- Parameters:
player- ThePlayerto consider.- Returns:
- The consequent
Change, or null if none.
-
toMessage
public AnimateMoveMessage toMessage(Player player)
Specialize a Change for a particular player.- Specified by:
toMessagein classChangeSet.Change<AnimateMoveMessage>- Parameters:
player- ThePlayerto update.- Returns:
- A specialized
Message.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-