| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A world resource.
Field Summary | |
final static int | LINEAR A linear transformation function. |
final static int | SLOPE A saturation transformation function. |
Constructor Summary | |
Resource(double value, double min, double max, int function) Create a new world resource. |
Method Summary | |
protected double | autoHasOthers(double value) Try to convert from other resources. |
protected double | autoModOthers(double amount) Try to transform another resource into this one. |
double | getMin() Get the minimal value of this world resource. |
String | getName() Get the name of this world resource. |
double | getValue() Get the value of this world resource. |
boolean | has(double value) See if we have enough of this resource. |
double | influence(double v) Influence a value by this resource. |
void | modValue(double v) Modify the value of this worldresource. |
protected void | setLimits(double min, double max, int function) Set the limits of this resource. |
void | setValue(double value) Set the value of this resource. |
Field Detail |
public final static int LINEAR
public final static int SLOPE
Constructor Detail |
public Resource(double value, double min, double max, int function)
Method Detail |
protected double autoHasOthers(double value)
protected double autoModOthers(double amount)
public double getMin()
public String getName()
public double getValue()
public boolean has(double value)
public double influence(double v)
public void modValue(double v)
throws NotEnoughResourcesException
protected void setLimits(double min, double max, int function)
public void setValue(double value)
throws NotEnoughResourcesException
| a gvijf production | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |