evolution.lands
Class LandResource

Direct Known Subclasses:
Coals, SimpleLandResource

public abstract class LandResource

A land resource.


Constructor Summary
LandResource(double value, double min, double max, boolean visible, String determination)
          Create a new land resource with the given value.

Method Summary
 doubleextract(double amount)
          Extract the given amount from this land resource.
 StringgetDetermination()
          How should the value of this resource be presented to the player.
 StringgetName()
          Get the name of this land resource.
 StringgetState()
          Get the state of this land resource.
 doublegetValue()
          The value of this land resource.
 doublegetVisibleValue()
          Get the visible value of this land resource.
 StringgetVisibleValueAsString()
          Get the visible value of this land resource.
 booleanisBoundary()
          Check whether the value of the landresources is still within the bounds.
 booleanisVisible()
          Is this land resource visible?
 protected voidsetBounds(double min, double max)
          Set the bounds for this landresource.
 protected voidsetDetermination(String determination)
          Set how the value of this resource should be presented to the player.
 protected voidsetValue(double value)
          Set the value of this land resource.
 voidsetVisible(boolean visible)
          Set the visibility of this land resource.

Constructor Detail

LandResource

public LandResource(double value, double min, double max, boolean visible, String determination)
Create a new land resource with the given value.
Parameters:
value - The value for this land resource.
min - The minimal value this resource can be at.
max - The maximum value this resource can be at.
visible - Is this land resource visible?
determination - How should the value of this resource be presented to the player. One of "boolean", "numeric".
Method Detail

extract

public double extract(double amount)
Extract the given amount from this land resource.
Throws:
NotEnoughLandResourcesException - If the amount extracted is greater than the available amount.

getDetermination

public String getDetermination()
How should the value of this resource be presented to the player.
returns One of "boolean", "numeric".

getName

public String getName()
Get the name of this land resource.

getState

public String getState()
Get the state of this land resource.

getValue

public double getValue()
The value of this land resource.

getVisibleValue

public double getVisibleValue()
Get the visible value of this land resource. If the value is 'Unknown', 0 is returned.

getVisibleValueAsString

public String getVisibleValueAsString()
Get the visible value of this land resource.

isBoundary

public boolean isBoundary()
Check whether the value of the landresources is still within the bounds.

isVisible

public boolean isVisible()
Is this land resource visible?

setBounds

protected void setBounds(double min, double max)
Set the bounds for this landresource.

setDetermination

protected void setDetermination(String determination)
Set how the value of this resource should be presented to the player.
Parameters:
determination - One of "boolean", "numeric".

setValue

protected void setValue(double value)
Set the value of this land resource.

setVisible

public void setVisible(boolean visible)
Set the visibility of this land resource.

Association Links

to Class java.lang.String

A string that indicates whether the value of this resource is shown as an exact amount (="numeric"), or whether only is indication if there are landresources or not ("boolean") .

a gvijf production