com.threerings.parlor.game.server
Class GameManagerDelegate

java.lang.Object
  extended by com.threerings.crowd.server.PlaceManagerDelegate
      extended by com.threerings.parlor.server.PlayManagerDelegate
          extended by com.threerings.parlor.game.server.GameManagerDelegate
Direct Known Subclasses:
PuzzleManagerDelegate, RatingDelegate, TurnGameManagerDelegate

public class GameManagerDelegate
extends PlayManagerDelegate

Extends the PlayManagerDelegate mechanism with game manager specific methods.


Field Summary
 
Fields inherited from class com.threerings.parlor.server.PlayManagerDelegate
_gmgr
 
Fields inherited from class com.threerings.crowd.server.PlaceManagerDelegate
_invmgr, _omgr, _plmgr
 
Constructor Summary
GameManagerDelegate()
           
GameManagerDelegate(GameManager gmgr)
          Deprecated. use the zero-argument constructor.
 
Method Summary
 void gameDidEnd()
          Called by the game manager after the game ended.
 void gameDidStart()
          Called by the game manager after the game was started.
 void gameWillEnd()
          Called by the game manager when the game is about to end.
 void gameWillReset()
          Called when the game is about to reset, but before any other clearing out of game data has taken place.
 void gameWillStart()
          Called by the game manager when the game is about to start.
 void playerWasReplaced(int pidx, Name oldPlayer, Name newPlayer)
          Called when a player in the game has been replaced by a call to GameManager.replacePlayer(int, com.threerings.util.Name).
 void setAI(int pidx, GameAI ai)
          Called when the specified player has been set as an AI with the supplied AI configuration.
 void tickAI(int pidx, GameAI ai)
          Called by the manager when we should do some AI.
 
Methods inherited from class com.threerings.parlor.server.PlayManagerDelegate
didInit, isAgent, isPlayer, verifyIsPlayer, verifyIsPlayerOrAgent, verifyWritePermission
 
Methods inherited from class com.threerings.crowd.server.PlaceManagerDelegate
addDispatcher, addProvider, bodyEntered, bodyLeft, bodyUpdated, didShutdown, didStartup, init, placeBecameEmpty, where
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GameManagerDelegate

public GameManagerDelegate()

GameManagerDelegate

@Deprecated
public GameManagerDelegate(GameManager gmgr)
Deprecated. use the zero-argument constructor.

Method Detail

gameWillStart

public void gameWillStart()
Called by the game manager when the game is about to start.


gameDidStart

public void gameDidStart()
Called by the game manager after the game was started.


playerWasReplaced

public void playerWasReplaced(int pidx,
                              Name oldPlayer,
                              Name newPlayer)
Called when a player in the game has been replaced by a call to GameManager.replacePlayer(int, com.threerings.util.Name).


tickAI

public void tickAI(int pidx,
                   GameAI ai)
Called by the manager when we should do some AI. Only called while the game is IN_PLAY.

Parameters:
pidx - the player index to fake some gameplay for.
ai - a record indicating the AI's configuration.

gameWillEnd

public void gameWillEnd()
Called by the game manager when the game is about to end.


gameDidEnd

public void gameDidEnd()
Called by the game manager after the game ended.


gameWillReset

public void gameWillReset()
Called when the game is about to reset, but before any other clearing out of game data has taken place. Derived classes should override this if they need to perform some pre-reset activities.


setAI

public void setAI(int pidx,
                  GameAI ai)
Called when the specified player has been set as an AI with the supplied AI configuration.