Revamped the player array in the game object to allow sparse player arrays

that may have one or more null player entries so that party games can
create their game with the maximum number of players they support and can
use the player index as the player's "seat".  Simplified some of the
jockeying we had to do when adding and removing players.  Complexified
some of the turn game management in order to deal properly with the sparse
player arrays.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1802 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Walter Korman
2002-10-15 23:07:23 +00:00
parent 1d7f033586
commit 21c599cd0a
7 changed files with 257 additions and 108 deletions
@@ -1,5 +1,5 @@
//
// $Id: TurnGameObject.java,v 1.3 2002/02/12 07:01:54 mdb Exp $
// $Id: TurnGameObject.java,v 1.4 2002/10/15 23:07:23 shaper Exp $
package com.threerings.parlor.turn;
@@ -20,8 +20,8 @@ public interface TurnGameObject
/**
* Returns the username of the player who is currently taking their
* turn in this turn-based game or null if no user currently holds the
* turn.
* turn in this turn-based game or <code>null</code> if no user
* currently holds the turn.
*/
public String getTurnHolder ();
@@ -30,4 +30,9 @@ public interface TurnGameObject
* value.
*/
public void setTurnHolder (String turnHolder);
/**
* Returns the array of player names involved in the game.
*/
public String[] getPlayers ();
}