Files
narya/src/java/com/threerings/parlor/turn/TurnGameManager.java
T
Michael Bayne 7a8908111b Oh the humanity. Modified the turn game services to be a "mix-in" using
the bastard Java technique of delegates and interfaces. I feel like I'm
doing OOP with one hand tied behind my back.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@989 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-02-12 06:57:30 +00:00

49 lines
1.4 KiB
Java

//
// $Id: TurnGameManager.java,v 1.5 2002/02/12 06:57:30 mdb Exp $
package com.threerings.parlor.turn;
import com.threerings.parlor.game.GameManager;
/**
* A game manager that wishes to make use of the turn game services should
* implement this interface and create a {@link TurnGameManagerDelegate}
* which will perform the basic turn game processing and call back to the
* main manager via this interface.
*
* <p> The basic flow of a turn-based game is as follows:
* <pre>
* GameManager.gameWillStart()
* GameManager.gameDidStart()
* TurnGameManagerDelegate.setFirstTurnHolder()
* TurnGameManagerDelegate.startTurn()
* TurnGameManager.turnWillStart()
* TurnGameManagerDelegate.endTurn()
* TurnGameManager.turnDidEnd()
* TurnGameManagerDelegate.setNextTurnHolder()
* TurnGameManagerDelegate.startTurn()
* ...
* GameManager.endGame()
* </pre>
*/
public interface TurnGameManager
{
/**
* Extending {@link GameManager} should automatically handle
* implementing this method.
*/
public String[] getPlayers ();
/**
* Called when we are about to start the next turn. Implementations
* can do whatever pre-turn activities need to be done.
*/
public void turnWillStart ();
/**
* Called when the turn was ended. Implementations can perform any
* post-turn processing (like updating scores, etc.).
*/
public void turnDidEnd ();
}