games.strategy.engine.data
Class Change

java.lang.Object
  extended by games.strategy.engine.data.Change
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ChangeAttachmentChange, CompositeChange, UnitHitsChange

public abstract class Change
extends java.lang.Object
implements java.io.Serializable

Version:
1.0 Not an interface because we want the perform() method to be protected. A Change encapsulates something that can be done to GameData. We use changes so that we can serialize and track change to GameData as they occur. When a change is performed on a GameData in a game, the change is serialized and sent across the network to all the clients. Since all changes to GameData are done through changes and all changes are serialized to all clients, all clients should always be in sync. A Change can be inverted to create an equal but opposite change. Use ChangeFactory to create Changes.
Author:
Sean Bridges
See Also:
Serialized Form

Constructor Summary
Change()
           
 
Method Summary
abstract  Change invert()
           
 boolean isEmpty()
           
protected abstract  void perform(GameData data)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Change

public Change()
Method Detail

perform

protected abstract void perform(GameData data)

invert

public abstract Change invert()

isEmpty

public boolean isEmpty()