public class Player
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
int |
allUnitCount()
Retrieves the total number of units that the player has.
|
boolean |
canMake(UnitType type)
Returns true if the this player can train/build the given type immediately.
|
boolean |
canMake(Unit builder,
UnitType type) |
boolean |
canResearch(TechType type)
Returns true, if this player can research the given tech immediately.
|
boolean |
canUpgrade(UpgradeType type) |
int |
completedUnitCount()
Retrieves the number of completed units that the player has.
|
int |
deadUnitCount()
Retrieves the number units that have died for this player.
|
int |
gas()
Retrieves the current amount of vespene gas that this player has.
|
int |
gatheredGas()
Retrieves the cumulative amount of vespene gas that this player has gathered since the
beginning of the game, including the amount that the player starts the game with (if any).
|
int |
gatheredMinerals()
Retrieves the cumulative amount of minerals/ore that this player has gathered since the
beginning of the game, including the amount that the player starts the game with (if any).
|
int |
getBuildingScore()
Retrieves the total building score, as seen in the end-game score screen.
|
Color |
getColor()
Retrieves the color value of the current player.
|
int |
getCustomScore()
Retrieves the player's custom score.
|
int |
getId()
Retrieves a unique ID that represents the player.
|
int |
getKillScore()
Retrieves the total kill score, as seen in the end-game score screen.
|
static java.util.Collection<UnitType> |
getMissingUnits(java.util.Collection<? extends PlayerUnit> group,
java.util.Collection<UnitType> types) |
java.lang.String |
getName()
Retrieves the name of the player.
|
Race |
getRace()
Retrieves the race of the player.
|
int |
getRazingScore()
Retrieves the total razing score, as seen in the end-game score screen.
|
TilePosition |
getStartLocation()
Retrieve's the player's starting location.
|
char |
getTextColor()
Retrieves the control code character that changes the color of text messages to represent this
player.
|
PlayerType |
getType()
Retrieves the player's controller type.
|
int |
getUnitScore()
Retrieves the total unit score, as seen in the end-game score screen.
|
UnitStatCalculator |
getUnitStatCalculator() |
int |
getUpgradeLevel(UpgradeType upgrade)
Retrieves the current upgrade level that the player has attained for a given upgrade type.
|
boolean |
hasResearched(TechType tech)
Checks if the player has already researched a given technology.
|
int |
incompleteUnitCount()
Retrieves the number of incomplete units that the player has.
|
void |
initialize()
Initializes a player with static information (constant through the course of a game).
|
boolean |
isAlly() |
boolean |
isDefeated()
Checks if the player has been defeated.
|
boolean |
isEnemy() |
boolean |
isNeutral()
Checks if this player is the neutral player.
|
boolean |
isObserver()
Checks if the player is an observer player, typically in a Use Map Settings observer game.
|
boolean |
isResearching(TechType tech)
Checks if the player is researching a given technology type.
|
boolean |
isUpgrading(UpgradeType upgrade)
Checks if the player is upgrading a given upgrade type.
|
boolean |
isVictorious()
Checks if the player has achieved victory.
|
int |
killedUnitCount()
Retrieves the number units that the player has killed.
|
boolean |
leftGame()
Checks if the player has left the game.
|
int |
minerals()
Retrieves the current amount of minerals/ore that this player has.
|
int |
refundedGas()
Retrieves the cumulative amount of vespene gas that this player has gained from refunding
(cancelling) units and structures.
|
int |
refundedMinerals()
Retrieves the cumulative amount of minerals/ore that this player has gained from refunding
(cancelling) units and structures.
|
int |
repairedGas()
Retrieves the cumulative amount of vespene gas that this player has spent on repairing units
since the beginning of the game.
|
int |
repairedMinerals()
Retrieves the cumulative amount of minerals/ore that this player has spent on repairing units
since the beginning of the game.
|
int |
spentGas()
Retrieves the cumulative amount of vespene gas that this player has spent, excluding repairs.
|
int |
spentMinerals()
Retrieves the cumulative amount of minerals/ore that this player has spent, excluding repairs.
|
int |
supplyTotal()
Retrieves the total amount of supply the player has available for unit control.
|
int |
supplyTotal(Race race) |
int |
supplyUsed()
Retrieves the current amount of supply that the player is using for unit control.
|
int |
supplyUsed(Race race) |
void |
update(int[] extra)
Updates dynamic player information.
|
int |
visibleUnitCount()
Retrieves the total number of strictly visible units that the player has, even if information
on the player is unrestricted.
|
public void initialize()
public void update(int[] extra)
public boolean isAlly()
public boolean isEnemy()
public int getId()
public java.lang.String getName()
public Race getRace()
public PlayerType getType()
public boolean isNeutral()
public TilePosition getStartLocation()
public boolean isVictorious()
public boolean isDefeated()
public boolean leftGame()
public int minerals()
public int gas()
public int gatheredMinerals()
public int gatheredGas()
public int repairedMinerals()
public int repairedGas()
public int refundedMinerals()
public int refundedGas()
public int spentMinerals()
public int spentGas()
public int supplyTotal()
public int supplyTotal(Race race)
public int supplyUsed()
public int supplyUsed(Race race)
public int allUnitCount()
public int visibleUnitCount()
public int completedUnitCount()
public int incompleteUnitCount()
public int deadUnitCount()
public int killedUnitCount()
public int getUpgradeLevel(UpgradeType upgrade)
public boolean hasResearched(TechType tech)
public boolean isResearching(TechType tech)
public boolean isUpgrading(UpgradeType upgrade)
public Color getColor()
public char getTextColor()
public UnitStatCalculator getUnitStatCalculator()
public int getUnitScore()
public int getKillScore()
public int getBuildingScore()
public int getRazingScore()
public int getCustomScore()
public boolean isObserver()
public boolean canMake(UnitType type)
public boolean canResearch(TechType type)
public boolean canUpgrade(UpgradeType type)
public static java.util.Collection<UnitType> getMissingUnits(java.util.Collection<? extends PlayerUnit> group, java.util.Collection<UnitType> types)