public class Player
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
private int |
armySize |
CatanColor |
color |
private boolean |
isRobot |
java.lang.String |
name |
Bank |
playerBank |
private int |
playerID |
private int |
playerIndex |
private static long |
serialVersionUID |
Constructor and Description |
---|
Player(java.lang.String name,
int index,
CatanColor playerColor,
boolean isHuman)
Creates a Player
|
Player(java.lang.String name,
int index,
CatanColor playerColor,
boolean isHuman,
int ID) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
int |
getArmySize()
Gets this player's army size
|
int |
hashCode() |
int |
incrementArmySize()
Increments this player's army size
|
boolean |
isARobot()
A simple function to determine if the player is controlled by AI
|
int |
playerID()
Returns the player ID
|
int |
playerIndex()
Returns the playerIndex so it can't be changed
|
java.lang.String |
toString() |
int |
totalResources() |
private static final long serialVersionUID
public java.lang.String name
public CatanColor color
public Bank playerBank
private int playerIndex
private int playerID
private boolean isRobot
private int armySize
public Player(java.lang.String name, int index, CatanColor playerColor, boolean isHuman)
name
- the name of the playerindex
- the player's indexplayerColor
- the color of the player's game piecesisHuman
- whether the player is a human or computer playerpublic Player(java.lang.String name, int index, CatanColor playerColor, boolean isHuman, int ID)
public int getArmySize()
public int incrementArmySize()
public boolean isARobot()
public int playerIndex()
public int playerID()
public int totalResources()
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object