Added turnDidStart().

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1627 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Walter Korman
2002-08-06 23:23:39 +00:00
parent 567e51f08a
commit 5262a10a69
2 changed files with 15 additions and 6 deletions
@@ -1,5 +1,5 @@
// //
// $Id: TurnGameManager.java,v 1.6 2002/06/19 23:18:58 mdb Exp $ // $Id: TurnGameManager.java,v 1.7 2002/08/06 23:23:39 shaper Exp $
package com.threerings.parlor.turn; package com.threerings.parlor.turn;
@@ -42,10 +42,16 @@ public interface TurnGameManager
/** /**
* Called when we are about to start the next turn. Implementations * Called when we are about to start the next turn. Implementations
* can do whatever pre-turn activities need to be done. * can do whatever pre-start turn activities need to be done.
*/ */
public void turnWillStart (); public void turnWillStart ();
/**
* Called when we have started the next turn. Implementations can do
* whatever post-start turn activities need to be done.
*/
public void turnDidStart ();
/** /**
* Called when the turn was ended. Implementations can perform any * Called when the turn was ended. Implementations can perform any
* post-turn processing (like updating scores, etc.). * post-turn processing (like updating scores, etc.).
@@ -1,5 +1,5 @@
// //
// $Id: TurnGameManagerDelegate.java,v 1.5 2002/06/19 23:18:58 mdb Exp $ // $Id: TurnGameManagerDelegate.java,v 1.6 2002/08/06 23:23:39 shaper Exp $
package com.threerings.parlor.turn; package com.threerings.parlor.turn;
@@ -13,7 +13,7 @@ import com.threerings.parlor.util.MathUtil;
/** /**
* Performs the server-side turn-based game processing for a turn based * Performs the server-side turn-based game processing for a turn based
* game. Game managers which wish to make use of the turn services must * game. Game managers which wish to make use of the turn services must
* implement {@link TurnGameManager} either create an instance of this * implement {@link TurnGameManager} and either create an instance of this
* class, or an instance of a derivation which customizes the behavior, * class, or an instance of a derivation which customizes the behavior,
* either of which would be passed to {@link GameManager#addDelegate} to * either of which would be passed to {@link GameManager#addDelegate} to
* be activated. * be activated.
@@ -69,11 +69,14 @@ public class TurnGameManagerDelegate extends GameManagerDelegate
return; return;
} }
// let the derived class do their thing // do pre-start processing
_tgmgr.turnWillStart(); _tgmgr.turnWillStart();
// and set the turn indicator accordingly // and set the turn indicator accordingly
_turnGame.setTurnHolder(_tgmgr.getPlayerName(_turnIdx)); _turnGame.setTurnHolder(_tgmgr.getPlayerName(_turnIdx));
// do post-start processing
_tgmgr.turnDidStart();
} }
/** /**
@@ -127,7 +130,7 @@ public class TurnGameManagerDelegate extends GameManagerDelegate
} }
/** /**
* This is called to determine whichi player will take the first * This is called to determine which player will take the first
* turn. The default implementation chooses a player at random. * turn. The default implementation chooses a player at random.
*/ */
protected void setFirstTurnHolder () protected void setFirstTurnHolder ()