public class Player
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.lang.Boolean |
Active
A variable determining if the player is currently active.
|
private College |
College
The college that the player is playing as.
|
private Trade |
currentTrade |
private int |
EnergyCount
An integer storing the amount of energy a player owns.
|
private int |
FoodCount
An integer storing the amount of food a player owns.
|
private int |
inventoryRoboticons
The number of Roboticons that the player owns
|
private int |
money
An integer storing the amount of money a player owns.
|
private java.lang.String |
name |
private int |
OreCount
An integer storing the amount of ore the player owns.
|
private int |
playerID
Unique numerical identifier of the player.
|
private java.util.List<Tile> |
TileList
A list of the tiles that the player owns.
|
Constructor and Description |
---|
Player(int playerID,
java.lang.String name)
The constructor of the class
|
Modifier and Type | Method and Description |
---|---|
void |
assignCollege(College College)
Changes the college of the player to the one that is specified.
|
void |
assignName(java.lang.String name) |
void |
assignTile(Tile Tile)
Adds the specified tile to the players list of tiles.
|
int |
calculateScore()
Calculates the score of the player based on the resources that they own.
|
void |
decreaseRoboticonInventory()
Decrements the number of Roboticons owned by the player
|
College |
getCollege()
Returns the college assigned to the player
|
int |
getEnergyCount()
Getter for EnergyCount
|
int |
getFoodCount()
Getter for FoodCount
|
int |
getInventoryRoboticons()
Getter for Inventory Roboticon Count
|
int |
getMoney()
Getter for the money attribute of the player
|
java.lang.String |
getName() |
int |
getOreCount()
Getter for OreCount
|
int |
getPlayerID() |
int |
getPlayerNumber() |
int |
getRoboticonInventory()
Returns the number of Roboticons owned by the player
|
java.util.List<Tile> |
getTileList()
Getter for the tile list of the Player
|
Trade |
getTrade() |
void |
increaseRoboticonInventory()
Increments the number of Roboticons owned by the player
|
boolean |
isAi() |
void |
setEnergyCount(int Newcount)
Setter for Energycount
|
void |
setFoodCount(int Newcount)
Setter for Foodcount
|
void |
setMoney(int newMoney)
Setter for the money attribute
|
void |
setOreCount(int Newcount)
Setter for Orecount
|
void |
setTrade(Trade trade) |
void |
toggleActive()
Toggles the 'active' attribute of the player from True to False or False to True.
|
void |
varyResource(java.lang.String resource,
int amount)
Increases/decreases the specified resource of the player by the specified amount
|
private int playerID
private int OreCount
private int FoodCount
private int EnergyCount
private int money
private java.lang.Boolean Active
private College College
private java.lang.String name
private java.util.List<Tile> TileList
private int inventoryRoboticons
private Trade currentTrade
public Player(int playerID, java.lang.String name)
playerID
- The id of the player that is being created. Should be an integer greater than 0.public boolean isAi()
public java.lang.String getName()
public int getPlayerID()
public int getPlayerNumber()
public java.util.List<Tile> getTileList()
public int getMoney()
public void setMoney(int newMoney)
newMoney
- int value corresponding to the new money value desiredpublic int getOreCount()
public void setOreCount(int Newcount)
Newcount
- int value that the Orecount is set topublic int getEnergyCount()
public void setEnergyCount(int Newcount)
Newcount
- int value that the Energycount is set topublic int getFoodCount()
public void setFoodCount(int Newcount)
Newcount
- int value that the Foodcount is set topublic void toggleActive()
public void assignName(java.lang.String name)
public void assignCollege(College College)
College
- The college that the player is being assigned to.public void assignTile(Tile Tile)
Tile
- The tile that is to be added to the player's tile list.public void varyResource(java.lang.String resource, int amount)
resource
- The resource that is to be modified.amount
- The amount that the player's resource is to change by. Negative value for a decrease, positive for an increase.public int calculateScore()
public void increaseRoboticonInventory()
public void decreaseRoboticonInventory()
public int getInventoryRoboticons()
public int getRoboticonInventory()
public College getCollege()
public void setTrade(Trade trade)
public Trade getTrade()