Package net.sf.freecol.common.networking
Class ChangeSet.ObjectChange
- java.lang.Object
-
- net.sf.freecol.common.networking.ChangeSet.Change<UpdateMessage>
-
- net.sf.freecol.common.networking.ChangeSet.ObjectChange
-
- Enclosing class:
- ChangeSet
private static class ChangeSet.ObjectChange extends ChangeSet.Change<UpdateMessage>
Encapsulate a FreeColGameObject update.
-
-
Field Summary
Fields Modifier and Type Field Description protected FreeColGameObject
fcgo
-
Fields inherited from class net.sf.freecol.common.networking.ChangeSet.Change
see
-
-
Constructor Summary
Constructors Constructor Description ObjectChange(ChangeSet.See see, FreeColGameObject fcgo)
Build a new ObjectChange for a single object.
-
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.boolean
matches(FreeColGameObject fcgo)
Does this Change operate on the given object?UpdateMessage
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
-
-
-
-
Field Detail
-
fcgo
protected final FreeColGameObject fcgo
-
-
Constructor Detail
-
ObjectChange
public ObjectChange(ChangeSet.See see, FreeColGameObject fcgo)
Build a new ObjectChange for a single object.- Parameters:
see
- The visibility of this change.fcgo
- TheFreeColGameObject
to update.
-
-
Method Detail
-
matches
public boolean matches(FreeColGameObject fcgo)
Does this Change operate on the given object?- Overrides:
matches
in classChangeSet.Change<UpdateMessage>
- 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.- Overrides:
isNotifiable
in classChangeSet.Change<UpdateMessage>
- Parameters:
player
- ThePlayer
to consider.- Returns:
- True if this
Change
should be sent.
-
toMessage
public UpdateMessage toMessage(Player player)
Specialize a Change for a particular player.- Specified by:
toMessage
in classChangeSet.Change<UpdateMessage>
- Parameters:
player
- ThePlayer
to update.- Returns:
- A specialized
Message
.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-