com.threerings.parlor.game.server
Class GameWatcher<T extends GameObject>

java.lang.Object
  extended by com.threerings.parlor.game.server.GameWatcher<T>
All Implemented Interfaces:
AttributeChangeListener, ChangeListener

public abstract class GameWatcher<T extends GameObject>
extends Object
implements AttributeChangeListener

An abstract convenience class used server-side to keep an eye on a game and perform a one-time game-over activity when the game ends. Classes that care to make use of the game watcher should create an instance with their newly created GameObject and implement gameDidEnd(T).


Field Summary
protected  T _gameobj
          The game object we're observing.
 
Constructor Summary
GameWatcher()
           
 
Method Summary
 void attributeChanged(AttributeChangedEvent event)
           
protected abstract  void gameDidEnd(T gameobj)
          Called when the game ends to give derived classes a chance to engage in their game-over antics.
 void init(PlaceManager plmgr)
           
 void init(T gameobj)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_gameobj

protected T extends GameObject _gameobj
The game object we're observing.

Constructor Detail

GameWatcher

public GameWatcher()
Method Detail

init

public void init(PlaceManager plmgr)

init

public void init(T gameobj)

attributeChanged

public void attributeChanged(AttributeChangedEvent event)
Specified by:
attributeChanged in interface AttributeChangeListener

gameDidEnd

protected abstract void gameDidEnd(T gameobj)
Called when the game ends to give derived classes a chance to engage in their game-over antics.