Moved game reset processing into main game framework. Also modified game

start processing on the server so that we don't want for the IN_PLAY
attribute change to be processed before calling gameDidStart() because we
don't want to do that when resetting the game (because someone could come
along and end the game in between gameWillStart() and gameDidStart() which
would be annoying and bad), so we need to be consistent and run straight
through both when starting the game for the first time and when resetting
it.

This means that game managers that really need to wait until their events
are processed and do some game start processing at that point will have to
listen for the IN_PLAY transition themselves *and* they'll have to be
aware that someone could have come along and ended the game in between the
call to gameDidStart() and the dispatch of the IN_PLAY event. Sketchy, but
unavoidable.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1235 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2002-04-14 00:26:05 +00:00
parent 5ec2bdcfe0
commit fd87ec437a
4 changed files with 145 additions and 14 deletions
@@ -1,5 +1,5 @@
//
// $Id: GameManagerDelegate.java,v 1.1 2002/02/13 03:21:28 mdb Exp $
// $Id: GameManagerDelegate.java,v 1.2 2002/04/14 00:26:05 mdb Exp $
package com.threerings.parlor.game;
@@ -40,4 +40,22 @@ public class GameManagerDelegate extends PlaceManagerDelegate
public void gameDidEnd ()
{
}
/**
* 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.
*/
public void gameWillReset ()
{
}
/**
* Called after the game has been reset. Derived classes can override
* this to put whatever wheels they might need into motion now that
* the game is reset.
*/
public void gameDidReset ()
{
}
}