Package net.sf.freecol.common.networking
Class ChangeSet.FeatureChange
- java.lang.Object
-
- net.sf.freecol.common.networking.ChangeSet.Change<FeatureChangeMessage>
-
- net.sf.freecol.common.networking.ChangeSet.FeatureChange
-
- Enclosing class:
- ChangeSet
private static class ChangeSet.FeatureChange extends ChangeSet.Change<FeatureChangeMessage>
Encapsulate a feature change.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
add
private FreeColObject
child
private FreeColGameObject
parent
-
Fields inherited from class net.sf.freecol.common.networking.ChangeSet.Change
see
-
-
Constructor Summary
Constructors Constructor Description FeatureChange(ChangeSet.See see, FreeColGameObject parent, FreeColObject child, boolean add)
Build a new FeatureChange.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isNotifiable(Player player)
Should a player be notified of this Change? Override in subclasses with special cases.FeatureChangeMessage
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, consequence, matches
-
-
-
-
Field Detail
-
parent
private final FreeColGameObject parent
-
child
private final FreeColObject child
-
add
private final boolean add
-
-
Constructor Detail
-
FeatureChange
public FeatureChange(ChangeSet.See see, FreeColGameObject parent, FreeColObject child, boolean add)
Build a new FeatureChange.- Parameters:
see
- The visibility of this change.parent
- TheFreeColGameObject
to update.child
- TheFreeColObject
value to add or remove.add
- If true, add the child, if not, remove it.
-
-
Method Detail
-
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<FeatureChangeMessage>
- Parameters:
player
- ThePlayer
to consider.- Returns:
- True if this
Change
should be sent.
-
toMessage
public FeatureChangeMessage toMessage(Player player)
Specialize a Change for a particular player.- Specified by:
toMessage
in classChangeSet.Change<FeatureChangeMessage>
- Parameters:
player
- ThePlayer
to update.- Returns:
- A specialized
Message
.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-