|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.colossus.game.Player
public class Player
A player in a game.
This class holds all information describing a player in a game, such
as the current legions and the score. Instances of this class are always bound to
an instance of Game
.
TODO there is an excessive amount of methods around the markersAvailable list.
Field Summary | |
---|---|
private PlayerColor |
color
The label of the color we use. |
private boolean |
dead
Set to true if the player is dead. |
private boolean |
deadBeforeSave
Only needed during loading of a game. |
private Game |
game
The game this information belongs to. |
private java.util.List<Legion> |
legions
The current legions owned by this player. |
private java.util.SortedSet<java.lang.String> |
markersAvailable
Sorted set of available legion markers for this player. |
private int |
mulligansLeft
|
private java.lang.String |
name
A name for this player for UI purposes and as identifier. |
private int |
number
The number of the player in the game. |
private java.lang.String |
playersEliminated
A string representing all players eliminated by this player. |
private int |
score
|
private MasterHex |
startingTower
The starting tower of the player. |
private java.lang.String |
type
The type of player: local human, AI or network. |
Constructor Summary | |
---|---|
Player(Game game,
java.lang.String playerName,
int number)
|
Method Summary | |
---|---|
void |
addLegion(Legion legion)
|
void |
addMarkerAvailable(java.lang.String markerId)
|
void |
addPlayerElim(Player player)
|
boolean |
canTitanTeleport()
|
void |
clearMarkersAvailable()
|
PlayerColor |
getColor()
|
boolean |
getDeadBeforeSave()
During loading of a game, this player was already dead in the game before saving. |
java.lang.String |
getFirstAvailableMarker()
|
Game |
getGame()
|
Legion |
getLegionByMarkerId(java.lang.String markerId)
|
java.util.List<? extends Legion> |
getLegions()
TODO should be List PlayerServerSide.die(Player) still
removes items |
java.util.Set<java.lang.String> |
getMarkersAvailable()
|
int |
getMulligansLeft()
|
java.lang.String |
getName()
|
int |
getNumber()
|
int |
getNumCreatures()
|
int |
getNumLegions()
|
int |
getNumMarkersAvailable()
|
java.lang.String |
getPlayersElim()
|
int |
getScore()
|
java.lang.String |
getShortColor()
|
MasterHex |
getStartingTower()
|
java.lang.String |
getTitanBasename()
Return the full basename for the titan of this player. |
Legion |
getTitanLegion()
|
int |
getTitanPower()
|
int |
getTotalPointValue()
Return the total value of all of this player's creatures. |
java.lang.String |
getType()
|
boolean |
hasLegion(java.lang.String markerId)
|
boolean |
hasMoved()
Check if the player has already moved. |
boolean |
hasTeleported()
|
boolean |
isAI()
|
boolean |
isDead()
|
boolean |
isHuman()
|
boolean |
isLocalHuman()
|
boolean |
isMarkerAvailable(java.lang.String markerId)
|
boolean |
isNetwork()
|
boolean |
isNone()
|
void |
removeAllLegions()
|
void |
removeLegion(Legion legion)
|
void |
removeMarkerAvailable(java.lang.String markerId)
|
java.lang.String |
selectMarkerId(java.lang.String markerId)
Removes the selected marker from the list of those available. |
void |
setColor(PlayerColor color)
|
void |
setDead(boolean dead)
|
void |
setDeadBeforeSave(boolean val)
|
void |
setMulligansLeft(int mulligansLeft)
|
void |
setName(java.lang.String name)
|
void |
setPlayersElim(java.lang.String playersEliminated)
|
void |
setScore(int score)
|
void |
setStartingTower(MasterHex startingTower)
|
void |
setType(java.lang.String type)
|
java.lang.String |
toString()
Overridden for debug/logging purposes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private final Game game
private java.lang.String name
private final java.util.List<Legion> legions
private final int number
private boolean dead
private boolean deadBeforeSave
private MasterHex startingTower
private PlayerColor color
startingTower
this should be set only once but probably
can't be set in the constructor.
private java.lang.String type
private java.lang.String playersEliminated
private int mulligansLeft
private int score
private final java.util.SortedSet<java.lang.String> markersAvailable
Constructor Detail |
---|
public Player(Game game, java.lang.String playerName, int number)
Method Detail |
---|
public Game getGame()
public java.util.List<? extends Legion> getLegions()
PlayerServerSide.die(Player)
still
removes items
public int getNumber()
public java.lang.String getName()
public void setName(java.lang.String name)
public boolean isDead()
public void setDead(boolean dead)
public boolean getDeadBeforeSave()
public void setDeadBeforeSave(boolean val)
public void setType(java.lang.String type)
public java.lang.String getType()
public boolean isHuman()
public boolean isLocalHuman()
public boolean isNetwork()
public boolean isNone()
public boolean isAI()
public void setStartingTower(MasterHex startingTower)
public MasterHex getStartingTower()
public void setColor(PlayerColor color)
public PlayerColor getColor()
public java.lang.String getShortColor()
public java.lang.String getPlayersElim()
public void setPlayersElim(java.lang.String playersEliminated)
public void addPlayerElim(Player player)
public Legion getLegionByMarkerId(java.lang.String markerId)
public boolean hasLegion(java.lang.String markerId)
public Legion getTitanLegion()
public void addLegion(Legion legion)
public void removeLegion(Legion legion)
public void removeAllLegions()
public void addMarkerAvailable(java.lang.String markerId)
public void removeMarkerAvailable(java.lang.String markerId)
public void clearMarkersAvailable()
public java.util.Set<java.lang.String> getMarkersAvailable()
public int getNumMarkersAvailable()
public java.lang.String getFirstAvailableMarker()
public boolean isMarkerAvailable(java.lang.String markerId)
public java.lang.String selectMarkerId(java.lang.String markerId)
public int getNumCreatures()
public java.lang.String toString()
toString
in class java.lang.Object
public void setMulligansLeft(int mulligansLeft)
public int getMulligansLeft()
public void setScore(int score)
public int getScore()
public int getTitanPower()
public boolean canTitanTeleport()
public int getTotalPointValue()
public boolean hasTeleported()
public boolean hasMoved()
public int getNumLegions()
public java.lang.String getTitanBasename()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |