Package worldBuilder
Class AttributeEngine
- java.lang.Object
-
- worldBuilder.AttributeEngine
-
public class AttributeEngine extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AttributeEngine.WhichMap
-
Constructor Summary
Constructors Constructor Description AttributeEngine(Map map)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
abort()
fall back to the last committed values (only for changed maps)boolean
autoPlacement(boolean[] selected, double[] quotas, AttributeEngine.WhichMap whichmap)
rule based resource placement for the selected pointsboolean
commit()
make the current values the fall-backs (in case of abort)boolean
placement(boolean[] selected, AttributeEngine.WhichMap whichmap, double value)
update the MeshPoint attributes for every selectedboolean
placementRules(java.lang.String ruleFile, java.lang.String[] classNames, AttributeEngine.WhichMap whichmap)
instantiate an auto-placement engine for the desired resource
-
-
-
Constructor Detail
-
AttributeEngine
public AttributeEngine(Map map)
-
-
Method Detail
-
placement
public boolean placement(boolean[] selected, AttributeEngine.WhichMap whichmap, double value)
update the MeshPoint attributes for every selected- Parameters:
selected
- array of per-MeshPoint booleans, True->selectedwhichmap
- RAIN, MINERAL, FLORA< FAUNAvalue
- new attribute value
-
placementRules
public boolean placementRules(java.lang.String ruleFile, java.lang.String[] classNames, AttributeEngine.WhichMap whichmap)
instantiate an auto-placement engine for the desired resource- Parameters:
ruleFile
- name of file containing placement rulesclassNames
- names of the placement classeswhichmap
- MINERAL, FLORA, FAUNA
-
autoPlacement
public boolean autoPlacement(boolean[] selected, double[] quotas, AttributeEngine.WhichMap whichmap)
rule based resource placement for the selected points- Parameters:
selected
- per-point booleans for selected pointsquotas
- fraction of points desired per classwhichmap
- MINERAL, FLORA, FAUNA
-
commit
public boolean commit()
make the current values the fall-backs (in case of abort)
-
abort
public boolean abort()
fall back to the last committed values (only for changed maps)
-
-