| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An action which humans can do.
Method Summary | |
protected abstract void | _perform(Human human) Extra things which should be done when this action's perform method is called. |
protected double | calculateSquareValue(SquareOfLand sq, Map neededResources, boolean maximizing) Calculate the value of the given square of land for this action. |
protected boolean | canBePerformedOn(SquareOfLand square) Checks whether this action can be performed on the given square of land. |
protected void | doChecks(Human human) Checks if this action can be performed by the human on the selected square of land. |
SquareOfLand | findSquare(SquareOfLand sq, int visionrange) Get the square in the range of a certain position where it is the most suitable to perform a given action. |
String | getName() Return the name of this action. |
protected Map | getProducesLandResources() Returns a map of the names of landresources that are produced by this action. |
protected Map | getProducesResources() Returns a map of the names of resources that are produced by this action. |
protected Map | getUsesLandResources() Returns a map of the names of landresources that are used by this action. |
protected Map | getUsesResources() Returns a map of the names of resources that are used by this action. |
boolean | hasEnoughResources() Checks whether this action had enough worldresources to be performed. |
boolean | isEnergyBufferAction() Checks whether this action is an energybufferaction = nofoodaction in our .prop files) |
protected void | modifyLandResources(SquareOfLand square, Map resources, double mul, boolean influencedBy) Modify the landresources that are mentioned in the given map. |
protected void | modifyResources(Map resources, double mul, boolean influencedBy) Modify the resources that are mentioned in the given map. |
void | perform(Human human) Perform the action. |
void | performEnergyBuffer(SquareOfLand square, Human human) A special case of perform |
Method Detail |
protected abstract void _perform(Human human)
throws evolution.resources.NotEnoughResourcesException,
IllegalLandTypeException,
evolution.lands.NotEnoughLandResourcesException
protected double calculateSquareValue(SquareOfLand sq, Map neededResources, boolean maximizing)
protected boolean canBePerformedOn(SquareOfLand square)
protected void doChecks(Human human)
throws evolution.resources.NotEnoughResourcesException,
IllegalLandTypeException,
evolution.lands.NotEnoughLandResourcesException
public SquareOfLand findSquare(SquareOfLand sq, int visionrange)
public String getName()
protected Map getProducesLandResources()
protected Map getProducesResources()
protected Map getUsesLandResources()
protected Map getUsesResources()
public boolean hasEnoughResources()
public boolean isEnergyBufferAction()
protected void modifyLandResources(SquareOfLand square, Map resources, double mul, boolean influencedBy)
throws evolution.lands.NotEnoughLandResourcesException
protected void modifyResources(Map resources, double mul, boolean influencedBy)
throws evolution.resources.NotEnoughResourcesException
public void perform(Human human)
throws evolution.resources.NotEnoughResourcesException,
IllegalLandTypeException,
evolution.lands.NotEnoughLandResourcesException
public void performEnergyBuffer(SquareOfLand square, Human human)
throws IllegalLandTypeException
| a gvijf production | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |