startGame() and endGame() need to be public to be accessible to the

delegates; added isGameOver() to standardize the way that the delegates
determine that the game is over (isGameOver() may need to be customized by
the games, so we want the delegates to use the game's custom code when
appropriate).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@996 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2002-02-13 18:50:15 +00:00
parent a00e7e5214
commit 6448309b0e
@@ -1,5 +1,5 @@
//
// $Id: GameManager.java,v 1.19 2002/02/13 03:21:28 mdb Exp $
// $Id: GameManager.java,v 1.20 2002/02/13 18:50:15 mdb Exp $
package com.threerings.parlor.game;
@@ -74,6 +74,14 @@ public class GameManager extends PlaceManager
return _players;
}
/**
* Returns whether the game is over.
*/
public boolean isGameOver ()
{
return (_gameobj.state == GameObject.GAME_OVER);
}
// documentation inherited
protected void didStartup ()
{
@@ -137,7 +145,7 @@ public class GameManager extends PlaceManager
* one or both of the calldown functions (rather than this function)
* if they need to do things before or after the game starts.
*/
protected void startGame ()
public void startGame ()
{
// let the derived class do its pre-start stuff
gameWillStart();
@@ -188,7 +196,7 @@ public class GameManager extends PlaceManager
* calldown functions to determine the winner of the game and then
* transition the game to the <code>GAME_OVER</code> state.
*/
protected void endGame ()
public void endGame ()
{
// figure out who won...