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 Tile
newTile
private Location
oldLocation
private Unit
unit
-
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.Change
consequence(Player player)
Are the secondary changes consequent to this Change?boolean
isNotifiable(Player player)
Should a player be notified of this Change? Override in subclasses with special cases.private boolean
seeNew(Player player)
Can a player see the new tile?private boolean
seeOld(Player player)
Can a player see the old tile?AnimateMoveMessage
toMessage(Player player)
Specialize a Change for a particular player.java.lang.String
toString()
-
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
- TheUnit
that is moving.oldLocation
- The location from which the unit is moving.newTile
- TheTile
to which the unit is moving.
-
-
Method Detail
-
seeOld
private boolean seeOld(Player player)
Can a player see the old tile?- Parameters:
player
- ThePlayer
to test.- Returns:
- True if the old tile is visible.
-
seeNew
private boolean seeNew(Player player)
Can a player see the new tile?- Parameters:
player
- ThePlayer
to 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:
isNotifiable
in classChangeSet.Change<AnimateMoveMessage>
- Parameters:
player
- ThePlayer
to consider.- Returns:
- True if this
Change
should be sent.
-
consequence
public ChangeSet.Change consequence(Player player)
Are the secondary changes consequent to this Change?- Overrides:
consequence
in classChangeSet.Change<AnimateMoveMessage>
- Parameters:
player
- ThePlayer
to consider.- Returns:
- The consequent
Change
, or null if none.
-
toMessage
public AnimateMoveMessage toMessage(Player player)
Specialize a Change for a particular player.- Specified by:
toMessage
in classChangeSet.Change<AnimateMoveMessage>
- Parameters:
player
- ThePlayer
to update.- Returns:
- A specialized
Message
.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-