Make the array of AI skill levels accessible so that delegates can figure
out what kind of AI-related machinations they should engage in during startup. Added isAI() to allow checking whether a particular player index belongs to an AI player. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1493 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: GameManager.java,v 1.34 2002/06/12 07:59:19 shaper Exp $
|
// $Id: GameManager.java,v 1.35 2002/06/19 23:06:08 shaper Exp $
|
||||||
|
|
||||||
package com.threerings.parlor.game;
|
package com.threerings.parlor.game;
|
||||||
|
|
||||||
@@ -72,10 +72,10 @@ public class GameManager extends PlaceManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the specified player as an AI with the specified skill.
|
* Sets the specified player as an AI with the specified skill. It is
|
||||||
* It is assumed that this will be set soon after the player names for all
|
* assumed that this will be set soon after the player names for all
|
||||||
* AIs present in the game. (It should be done before human players start
|
* AIs present in the game. (It should be done before human players
|
||||||
* trickling into the game.)
|
* start trickling into the game.)
|
||||||
*
|
*
|
||||||
* @param pidx the player index of the AI.
|
* @param pidx the player index of the AI.
|
||||||
* @param skill the skill level, from 0 to 100 inclusive.
|
* @param skill the skill level, from 0 to 100 inclusive.
|
||||||
@@ -103,6 +103,23 @@ public class GameManager extends PlaceManager
|
|||||||
return _players;
|
return _players;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns an array of the AI skill levels if AIs are present in this
|
||||||
|
* game.
|
||||||
|
*/
|
||||||
|
public byte[] getAIs ()
|
||||||
|
{
|
||||||
|
return _AIs;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether the player at the specified player index is an AI.
|
||||||
|
*/
|
||||||
|
public boolean isAI (int pidx)
|
||||||
|
{
|
||||||
|
return (_AIs != null && _AIs[pidx] != -1);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether the game is over.
|
* Returns whether the game is over.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user