public class Roboticon
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private Plot |
AssignedPlot |
private static int |
BASEPROD |
private int |
EnergyProd |
private int |
OreProd |
(package private) java.util.Random |
rnd |
private Resource |
Specialisation |
Constructor and Description |
---|
Roboticon()
Constructor for roboticons
|
Modifier and Type | Method and Description |
---|---|
int |
calcProd(Resource resource,
int playermod)
Calculate the modified production rate for a given resource
|
int |
getBaseProd(Resource resource)
Returns the base production value for a given resource
|
Plot |
getPlot()
Get the currently assigned plot object
|
Resource |
getSpec()
Returns the current specialisation as an enumerated resource type
|
boolean |
setBaseProd(Resource resource,
int newprod)
Sets the base production for the given resource to the given value
|
boolean |
setPlot(Plot plot)
Set the plot the roboticon is assigned to
|
boolean |
setSpec(Resource resource)
Takes an enumerated resource type and sets the specialisation
and base production rates accordingly
|
private static final int BASEPROD
private int OreProd
private int EnergyProd
private Resource Specialisation
private Plot AssignedPlot
java.util.Random rnd
public int getBaseProd(Resource resource)
resource
- the resource for which the base production is being requested as an enumerated typejava.lang.IllegalArgumentException
- exception if resource is unrecognisedpublic boolean setBaseProd(Resource resource, int newprod)
resource
- the resource for which the base production rate is being set as an enumerated typenewprod
- the new production rate as an integerjava.lang.IllegalArgumentException
- exception if resource is unrecognised or new value is negativepublic boolean setSpec(Resource resource)
resource
- the resource being set as an enumerated typejava.lang.IllegalArgumentException
- exception if resource is unrecognisedpublic Resource getSpec()
public boolean setPlot(Plot plot)
plot
- the plot object being assignedpublic Plot getPlot()
public int calcProd(Resource resource, int playermod)
resource
- the resource for which production is to be calculated as an enumerated typeplayermod
- the production modifiers on the player for that resource (eg. from events)java.lang.IllegalArgumentException
- exception if resource is unrecognised