Allow a game to delay its start until all of its players are actually ready

rather than assuming that as soon as they construct the EZGameControl, they're
ready to play. That's not totally unreasonable, but with this new explicit
mechanism, games can also "rematch" (or just replay if it's single player) by
having all clients call playerReady() again after the game has ended.


git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@328 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Michael Bayne
2007-06-25 20:36:16 +00:00
parent 15bbb435c7
commit b87eacd9d6
3 changed files with 43 additions and 12 deletions
@@ -56,7 +56,18 @@ public class EZGameController extends GameController
* This is called by the GameControlBackend once it has initialized and made contact with
* usercode.
*/
public function userCodeIsConnected () :void
public function userCodeIsConnected (autoReady :Boolean) :void
{
if (autoReady) {
playerIsReady();
}
}
/**
* Called by the GameControlBackend when the game is ready to start. If the game has ended,
* this can be called by all clients to start the game anew.
*/
public function playerIsReady () :void
{
playerReady();
}