com.threerings.parlor.game.server

## Class GameManagerDelegate

- java.lang.Object
- - com.threerings.crowd.server.PlaceManagerDelegate
  - - com.threerings.parlor.server.PlayManagerDelegate
    - - 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.

### Constructor Summary

Constructors
Constructor and Description
`GameManagerDelegate()`
`GameManagerDelegate(GameManager gmgr)` Deprecated. use the zero-argument constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`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, com.threerings.util.Name oldPlayer, com.threerings.util.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`

### Methods inherited from class com.threerings.crowd.server.PlaceManagerDelegate

`bodyEntered, bodyLeft, bodyUpdated, didShutdown, didStartup, init, placeBecameEmpty, where`

### Methods inherited from class java.lang.Object

`equals, 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,
                                  com.threerings.util.Name oldPlayer,
                                  com.threerings.util.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.