Package net.sf.freecol.common.networking
Class ChangeSet.Change<T extends Message>
- java.lang.Object
-
- net.sf.freecol.common.networking.ChangeSet.Change<T>
-
- Direct Known Subclasses:
ChangeSet.AttackChange
,ChangeSet.AttributeChange
,ChangeSet.FeatureChange
,ChangeSet.MessageChange
,ChangeSet.MoveChange
,ChangeSet.ObjectChange
,ChangeSet.PartialObjectChange
,ChangeSet.PlayerChange
,ChangeSet.RemoveChange
,ChangeSet.SpyChange
,ChangeSet.StanceChange
- Enclosing class:
- ChangeSet
public abstract static class ChangeSet.Change<T extends Message> extends java.lang.Object
Abstract template for all types of Change.
-
-
Field Summary
Fields Modifier and Type Field Description protected ChangeSet.See
see
The visibility of the change.
-
Constructor Summary
Constructors Constructor Description Change(ChangeSet.See see)
Make a new Change.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected ChangeSet.SeeCheck
check(Player player)
Check this changes visibility to a given player.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.boolean
matches(FreeColGameObject fcgo)
Does this Change operate on the given object?abstract T
toMessage(Player player)
Specialize a Change for a particular player.
-
-
-
Field Detail
-
see
protected final ChangeSet.See see
The visibility of the change.
-
-
Constructor Detail
-
Change
public Change(ChangeSet.See see)
Make a new Change.- Parameters:
see
- The visibility.
-
-
Method Detail
-
check
protected ChangeSet.SeeCheck check(Player player)
Check this changes visibility to a given player.- Parameters:
player
- Theplayer
to check.- Returns:
- The visibility result.
-
matches
public boolean matches(FreeColGameObject fcgo)
Does this Change operate on the given object?- Parameters:
fcgo
- TheFreeColGameObject
to check.- Returns:
- True if the object is a subject of this change.
-
isNotifiable
public boolean isNotifiable(Player player)
Should a player be notified of this Change? Override in subclasses with special cases.- 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?- Parameters:
player
- ThePlayer
to consider.- Returns:
- The consequent
Change
, or null if none.
-
-