|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--game.interfaces.Cost
An interface for costs.
| Field Summary | |
protected float |
decay
Rate at which value in associated Infrastructure class decays. |
protected float |
food
Food require required. |
protected boolean |
persistent
Whether this cost is persistent. |
protected float |
production
Production, sometimes called resources (I prefer production), required. |
protected float |
recruits
The cost in recruits. |
protected float |
services
Services. |
| Constructor Summary | |
Cost()
Constructor. |
|
| Method Summary | |
void |
add(Cost cost)
Add the parameter cost to this one. |
float |
getDecay()
Return the amount of decay. |
float |
getFood()
Return the amount of food. |
Cost |
getNormalizedCost()
Normalizes Cost. |
boolean |
getPersistent()
Return whether persistent. |
float |
getProduction()
Return the amount of production. |
float |
getRecruits()
Return the recruits required. |
float |
getServices()
Return the amount of services. |
void |
multiply(float multiplier)
Multiply all costs by the parameter. |
void |
setDecay(float value)
Set the amount of decay. |
void |
setFood(float value)
Set the amount of food. |
void |
setPersistent(boolean value)
Set whether persistent. |
void |
setProduction(float value)
Set the amount of production. |
void |
setRecruits(float value)
Set the recruits required. |
void |
setServices(float value)
Set the amount of services. |
boolean |
subtract(Cost toPay)
Tries to subtract another Cost object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected float food
protected float production
protected float services
protected float decay
protected boolean persistent
protected float recruits
| Constructor Detail |
public Cost()
| Method Detail |
public void setFood(float value)
value - the amount of food.public float getFood()
public void setProduction(float value)
value - the amount of production.public float getProduction()
public void setServices(float value)
value - the amount of services.public float getServices()
public void setDecay(float value)
value - the amount of decay.public float getDecay()
public void setPersistent(boolean value)
value - true if persistent.public boolean getPersistent()
public void setRecruits(float value)
value - the recruits required.public float getRecruits()
public void add(Cost cost)
public void multiply(float multiplier)
public boolean subtract(Cost toPay)
public Cost getNormalizedCost()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||