Added "is it my turn?" style function.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3463 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ted V
2005-04-11 23:50:29 +00:00
parent 0192a84739
commit 4e07b63ce1
@@ -65,6 +65,20 @@ public class TurnGameManagerDelegate extends GameManagerDelegate
return _tgmgr.getPlayerIndex(_turnGame.getTurnHolder());
}
/** Test if it's the inputted player's turn. */
public boolean isPlayersTurn (int playerIndex)
{
// Don't accidently match a visitor's id of -1 with the "no one's
// turn" state of turn -1.
int turnHolder = getTurnHolderIndex();
if (turnHolder < 0) {
return false;
}
// It's this player's turn if the ids match
return (turnHolder == playerIndex);
}
/**
* Called to start the next turn. It calls {@link
* TurnGameManager#turnWillStart} to allow our owning manager to