com.threerings.parlor.turn.server
Interface TurnGameManager

All Known Implementing Classes:
CardGameManager

public interface TurnGameManager

A game manager that wishes to make use of the turn game services should implement this interface and create a TurnGameManagerDelegate which will perform the basic turn game processing and call back to the main manager via this interface.

The basic flow of a turn-based game is as follows:

 GameManager.gameWillStart()
 GameManager.gameDidStart()
   TurnGameManagerDelegate.setFirstTurnHolder()
   TurnGameManagerDelegate.startTurn()
     TurnGameManager.turnWillStart()
   TurnGameManagerDelegate.endTurn()
     TurnGameManager.turnDidEnd()
   TurnGameManagerDelegate.setNextTurnHolder()
   TurnGameManagerDelegate.startTurn()
     ...
 GameManager.endGame()
 


Method Summary
 int getPlayerCount()
          Extending GameManager should automatically handle implementing this method.
 int getPlayerIndex(Name username)
          Extending GameManager should automatically handle implementing this method.
 Name getPlayerName(int index)
          Extending GameManager should automatically handle implementing this method.
 boolean isActivePlayer(int pidx)
          Extending GameManager should automatically handle implementing this method.
 void turnDidEnd()
          Called when the turn was ended.
 void turnDidStart()
          Called when we have started the next turn.
 void turnWillStart()
          Called when we are about to start the next turn.
 

Method Detail

getPlayerName

Name getPlayerName(int index)
Extending GameManager should automatically handle implementing this method.


getPlayerIndex

int getPlayerIndex(Name username)
Extending GameManager should automatically handle implementing this method.


getPlayerCount

int getPlayerCount()
Extending GameManager should automatically handle implementing this method.


isActivePlayer

boolean isActivePlayer(int pidx)
Extending GameManager should automatically handle implementing this method.


turnWillStart

void turnWillStart()
Called when we are about to start the next turn. Implementations can do whatever pre-start turn activities need to be done.


turnDidStart

void turnDidStart()
Called when we have started the next turn. Implementations can do whatever post-start turn activities need to be done.


turnDidEnd

void turnDidEnd()
Called when the turn was ended. Implementations can perform any post-turn processing (like updating scores, etc.).