From 3549b9cdaf5dbc5e3ded9659630012fff588d40f Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Fri, 11 Mar 2005 22:10:27 +0000 Subject: [PATCH] Do not require the playerStatus field to be initialized. If someone wants to write a simple board game for gamegardens, they shouldn't have to explicitly set up an array indicating that all the players are active (or worse, waste 45 minutes tracking down why the game is freezing up suddenly). If the playerStatus array is null, all players are active. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3397 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/parlor/game/data/GameObject.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/java/com/threerings/parlor/game/data/GameObject.java b/src/java/com/threerings/parlor/game/data/GameObject.java index 66e6ad5d7..aa696c2a3 100644 --- a/src/java/com/threerings/parlor/game/data/GameObject.java +++ b/src/java/com/threerings/parlor/game/data/GameObject.java @@ -109,9 +109,10 @@ public class GameObject extends PlaceObject /** The player index of the creating player if this is a party game. */ public int creator; - /** The status of each of the players in the game. The status value - * is one of {@link #PLAYER_LEFT_GAME} or {@link - * #PLAYER_IN_PLAY}. */ + /** If null, indicates that all present players are active, or for + * more complex games can be non-null to indicate the current status + * of each player in the game. The status value is one of + * {@link #PLAYER_LEFT_GAME} or {@link #PLAYER_IN_PLAY}. */ public int[] playerStatus; /** @@ -151,7 +152,7 @@ public class GameObject extends PlaceObject public boolean isActivePlayer (int pidx) { return (isOccupiedPlayer(pidx) && - playerStatus != null && playerStatus[pidx] == PLAYER_IN_PLAY); + (playerStatus == null || playerStatus[pidx] == PLAYER_IN_PLAY)); }