com.threerings.parlor.turn.client

## Class TurnGameControllerDelegate

- java.lang.Object
- - com.threerings.crowd.client.PlaceControllerDelegate
  - - com.threerings.parlor.game.client.GameControllerDelegate
    - - com.threerings.parlor.turn.client.TurnGameControllerDelegate

All Implemented Interfaces:
  com.threerings.presents.dobj.AttributeChangeListener, com.threerings.presents.dobj.ChangeListener

Direct Known Subclasses:
  TrickCardGameControllerDelegate

    public class TurnGameControllerDelegate
    extends GameControllerDelegate
    implements com.threerings.presents.dobj.AttributeChangeListener

Performs the client-side processing for a turn-based game. Games which wish to make use of these services must construct a delegate and call out to it at the appropriate times (see the method documentation for which methods should be called when). The game's controller must also implement the `TurnGameController` interface so that it can be notified when turn-based game events take place.

### Constructor Summary

Constructors
Constructor and Description
`TurnGameControllerDelegate(TurnGameController tgctrl)` Constructs a delegate which will call back to the supplied `TurnGameController` implementation wen turn-based game related things happen.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `attributeChanged(com.threerings.presents.dobj.AttributeChangedEvent event)`
`void` `didLeavePlace(com.threerings.crowd.data.PlaceObject plobj)`
`int` `getTurnHolderIndex()` Returns the index of the current turn holder as configured in the game object.
`void` `init(com.threerings.crowd.util.CrowdContext ctx, com.threerings.crowd.data.PlaceConfig config)`
`boolean` `isOurTurn()` Returns true if the game is in progress and it is our turn; false otherwise.
`void` `willEnterPlace(com.threerings.crowd.data.PlaceObject plobj)`

### Methods inherited from class com.threerings.parlor.game.client.GameControllerDelegate

`gameDidEnd, gameDidStart, gameWasCancelled, gameWillReset`

### Methods inherited from class com.threerings.crowd.client.PlaceControllerDelegate

`handleAction, mayLeavePlace`

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

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### TurnGameControllerDelegate

    public TurnGameControllerDelegate(TurnGameController tgctrl)

Constructs a delegate which will call back to the supplied `TurnGameController` implementation wen turn-based game related things happen.

### Method Detail

#### isOurTurn

    public boolean isOurTurn()

Returns true if the game is in progress and it is our turn; false otherwise.

#### getTurnHolderIndex

    public int getTurnHolderIndex()

Returns the index of the current turn holder as configured in the game object.

Returns:
  the index into the players array of the current turn holder or -1 if there is no current turn holder.

#### init

    public void init(com.threerings.crowd.util.CrowdContext ctx,
                     com.threerings.crowd.data.PlaceConfig config)

Overrides:
  `init` in class `com.threerings.crowd.client.PlaceControllerDelegate`

#### willEnterPlace

    public void willEnterPlace(com.threerings.crowd.data.PlaceObject plobj)

Overrides:
  `willEnterPlace` in class `com.threerings.crowd.client.PlaceControllerDelegate`

#### didLeavePlace

    public void didLeavePlace(com.threerings.crowd.data.PlaceObject plobj)

Overrides:
  `didLeavePlace` in class `com.threerings.crowd.client.PlaceControllerDelegate`

#### attributeChanged

    public void attributeChanged(com.threerings.presents.dobj.AttributeChangedEvent event)

Specified by:
  `attributeChanged` in interface `com.threerings.presents.dobj.AttributeChangeListener`