public class Player
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected int |
energy |
protected int |
money |
protected java.lang.String |
name |
protected int |
ore |
protected java.util.ArrayList<Plot> |
plots |
protected java.util.ArrayList<Roboticon> |
roboticons |
Constructor and Description |
---|
Player(java.lang.String name,
int money,
int ore,
int energy)
The is the constructor of the Player class to instantiate a new instance of the Player class
|
Modifier and Type | Method and Description |
---|---|
void |
AcquirePlot(Plot plot)
This allows the player to acquire a new plot which in turn adds the plot to the list of plots the player owns
|
void |
addRoboticon(Roboticon roboticon)
This adds a roboticon to the list of roboticons the player owns
|
int |
getEnergy()
This gets the amount of energy the player currently has
|
int |
getMoney()
This gets the amount of money the player currently has
|
java.lang.String |
getName() |
int |
getOre()
This gets the amount of ore the player currently has
|
java.util.ArrayList<Plot> |
getPlots()
This returns the list of plots that the player owns
|
java.util.ArrayList<Roboticon> |
getRoboticons()
Gets the list of Roboticons the player owns
|
java.util.ArrayList<Roboticon> |
getUnassignedRoboticons()
This returns the list of roboticons that currently have no assigned plot
|
java.util.ArrayList<Roboticon> |
getUnspecialisedRoboticons()
This returns the list of roboticons that currently have no specialisation
|
void |
ProduceResources()
This is the function to automatically produce the resources which is based upon the plots the player owns and the Roboticons which have been assigned.
|
void |
setEnergy(int energy)
This sets the energy the player has to specific value
|
void |
setMoney(int money)
This sets the money the player has to specific value
|
void |
setOre(int ore)
This sets the ore the player has to specific value
|
void |
SpecialiseRoboticon(Roboticon roboticon,
Resource resource)
Allow the player to specialise their roboticon to a given a resource
|
protected int money
protected int ore
protected int energy
protected java.util.ArrayList<Roboticon> roboticons
protected java.util.ArrayList<Plot> plots
protected java.lang.String name
public Player(java.lang.String name, int money, int ore, int energy)
name
- The name of the player object i.e Player 1money
- The starting money of the playerore
- The starting ore of the playerenergy
- The starting energy of the playerpublic void AcquirePlot(Plot plot) throws java.lang.Exception
plot
- The plot which is going to be acquired.java.lang.Exception
- If the plot already belongs to a playerpublic void SpecialiseRoboticon(Roboticon roboticon, Resource resource)
roboticon
- The roboticon to be specialisedresource
- The resource the roboticon will be specialised forpublic void ProduceResources()
public int getMoney()
public int getOre()
public int getEnergy()
public java.lang.String getName()
public void setMoney(int money)
money
- The value for the money to be set topublic void setOre(int ore)
ore
- The value for the ore to be set topublic void setEnergy(int energy)
energy
- The value for the energy to be set topublic java.util.ArrayList<Roboticon> getRoboticons()
ArrayList
public void addRoboticon(Roboticon roboticon)
roboticon
- The roboticon to be addedpublic java.util.ArrayList<Plot> getPlots()
public java.util.ArrayList<Roboticon> getUnspecialisedRoboticons()
public java.util.ArrayList<Roboticon> getUnassignedRoboticons()