Added the notion of a round with an associated round identifier that is
incremented whenever the game is reset. Games that don't make use of the resetting functionality essentially consist of a single round. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1420 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: GameController.java,v 1.14 2002/05/07 00:57:49 mdb Exp $
|
||||
// $Id: GameController.java,v 1.15 2002/06/03 21:08:57 shaper Exp $
|
||||
|
||||
package com.threerings.parlor.game;
|
||||
|
||||
@@ -123,6 +123,17 @@ public abstract class GameController extends PlaceController
|
||||
|
||||
// end the game until we receive a new board
|
||||
setGameOver(true);
|
||||
|
||||
// increment the round identifier
|
||||
_roundId++;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the unique round identifier for the current round.
|
||||
*/
|
||||
public int getRoundId ()
|
||||
{
|
||||
return _roundId;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -230,6 +241,9 @@ public abstract class GameController extends PlaceController
|
||||
* controlling. */
|
||||
protected GameObject _gobj;
|
||||
|
||||
/** The unique round identifier for the current round. */
|
||||
protected int _roundId;
|
||||
|
||||
/** A local flag overriding the game over state for situations where
|
||||
* the client knows the game is over before the server has
|
||||
* transitioned the game object accordingly. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: GameManager.java,v 1.31 2002/06/01 23:14:53 ray Exp $
|
||||
// $Id: GameManager.java,v 1.32 2002/06/03 21:08:57 shaper Exp $
|
||||
|
||||
package com.threerings.parlor.game;
|
||||
|
||||
@@ -106,6 +106,14 @@ public class GameManager extends PlaceManager
|
||||
return (_gameobj.state == GameObject.GAME_OVER);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the unique round identifier for the current round.
|
||||
*/
|
||||
public int getRoundId ()
|
||||
{
|
||||
return _roundId;
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
protected void didStartup ()
|
||||
{
|
||||
@@ -320,6 +328,9 @@ public class GameManager extends PlaceManager
|
||||
// let the derived class do its pre-reset stuff
|
||||
gameWillReset();
|
||||
|
||||
// increment the round identifier
|
||||
_roundId++;
|
||||
|
||||
// do the standard game start processing
|
||||
gameWillStart();
|
||||
_gameobj.setState(GameObject.IN_PLAY);
|
||||
@@ -439,8 +450,11 @@ public class GameManager extends PlaceManager
|
||||
/** The oids of our player and AI body objects. */
|
||||
protected int[] _playerOids;
|
||||
|
||||
/** The unique round identifier for the current round. */
|
||||
protected int _roundId;
|
||||
|
||||
/** If AIs are present, contains their skill levels, or -1 at human
|
||||
* player indexes.. */
|
||||
* player indexes. */
|
||||
protected byte[] _AIs;
|
||||
|
||||
/** Our delegate operator to tick AIs. */
|
||||
|
||||
Reference in New Issue
Block a user