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
This commit is contained in:
Michael Bayne
2006-04-02 18:39:25 +00:00
parent c696896f10
commit 2cc2e5fd00
@@ -151,8 +151,8 @@ public class GameObject extends PlaceObject
*/ */
public boolean isActivePlayer (int pidx) public boolean isActivePlayer (int pidx)
{ {
return (isOccupiedPlayer(pidx) && return isOccupiedPlayer(pidx) &&
(playerStatus == null || playerStatus[pidx] == PLAYER_IN_PLAY)); (playerStatus == null || isActivePlayerStatus(playerStatus[pidx]));
} }
@@ -247,6 +247,16 @@ public class GameObject extends PlaceObject
return PartyGameConfig.NOT_PARTY_GAME; 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 // documentation inherited
protected void which (StringBuffer buf) protected void which (StringBuffer buf)
{ {