From 2cc2e5fd009a67bc6bed97c4bd3b31547cdb2c9d Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Sun, 2 Apr 2006 18:39:25 +0000 Subject: [PATCH] Made it possible to make extended use of the playerStatus array. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3994 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../threerings/parlor/game/data/GameObject.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/java/com/threerings/parlor/game/data/GameObject.java b/src/java/com/threerings/parlor/game/data/GameObject.java index 670aa17d8..ae9adf690 100644 --- a/src/java/com/threerings/parlor/game/data/GameObject.java +++ b/src/java/com/threerings/parlor/game/data/GameObject.java @@ -151,8 +151,8 @@ public class GameObject extends PlaceObject */ public boolean isActivePlayer (int pidx) { - return (isOccupiedPlayer(pidx) && - (playerStatus == null || playerStatus[pidx] == PLAYER_IN_PLAY)); + return isOccupiedPlayer(pidx) && + (playerStatus == null || isActivePlayerStatus(playerStatus[pidx])); } @@ -247,6 +247,16 @@ public class GameObject extends PlaceObject return PartyGameConfig.NOT_PARTY_GAME; } + /** + * Used by {@link #isActivePlayer} to determine if the supplied status is + * associated with an active player (one that has not resigned from the + * game and/or left the game room). + */ + protected boolean isActivePlayerStatus (int playerStatus) + { + return playerStatus == PLAYER_IN_PLAY; + } + // documentation inherited protected void which (StringBuffer buf) {