Package worldBuilder

Class ResourceRule

  • Direct Known Subclasses:
    OverlayRule, RPGMRule

    public class ResourceRule
    extends java.lang.Object
    parameters and bids for a single resource (eg flora or mineral) that bids for MeshPoints or export tiles.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.lang.String className
      name of this rule and its class
      boolean debug
      Debug: trace bids from this rule
      boolean flexRange
      is there flexibility in these ranges
      java.lang.String floraType
      where can this creature live
      int id
      resource type ID #
      java.lang.String justification
      Debug: explain the basis for the last bid
      int maxAltitude
      Altitude ranges for this rule
      double maxDepth
      water-depth ranges for this rule
      double maxFlux
      river flux range for this rule
      double maxRain
      rainfall range for this rule
      double maxSlope
      slope ranges for this rule
      double maxTemp
      Temperature range for this rule
      int minAltitude
      Altitude ranges for this rule
      double minDepth
      water-depth ranges for this rule
      double minFlux
      river flux range for this rule
      double minRain
      rainfall range for this rule
      double minSlope
      slope ranges for this rule
      double minTemp
      Temperature range for this rule
      int order
      when, in the sequence of bids, does this go
      java.awt.Color previewColor
      what color should this render as in previews
      static java.lang.String ruleFile
      list of all ingested rules
      java.lang.String ruleName
      name of this rule and its class
      static java.lang.String ruleset  
      boolean taperedBid
      taper bids as we move away from mid-range
      int vigor
      how high should this rule bid
    • Constructor Summary

      Constructors 
      Constructor Description
      ResourceRule​(java.lang.String name)
      create a new subtype
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dump​(java.lang.String prefix)
      dump out a Rule (for debugging)
      static java.util.ListIterator<ResourceRule> iterator()  
      void loadRules​(java.lang.String file)
      load in resource placement rules
      void set_attribute​(java.lang.String name, int value)  
      void set_attribute​(java.lang.String name, java.lang.String value)  
      void set_range​(java.lang.String name, java.lang.String limit, double value)  
      static int size()  
      boolean wrongFlora​(java.lang.String floraClass)
      is this rule inapplicable to a particular floral class
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ruleFile

        public static java.lang.String ruleFile
        list of all ingested rules
      • ruleset

        public static java.lang.String ruleset
      • ruleName

        public java.lang.String ruleName
        name of this rule and its class
      • className

        public java.lang.String className
        name of this rule and its class
      • id

        public int id
        resource type ID #
      • minAltitude

        public int minAltitude
        Altitude ranges for this rule
      • maxAltitude

        public int maxAltitude
        Altitude ranges for this rule
      • minSlope

        public double minSlope
        slope ranges for this rule
      • maxSlope

        public double maxSlope
        slope ranges for this rule
      • minDepth

        public double minDepth
        water-depth ranges for this rule
      • maxDepth

        public double maxDepth
        water-depth ranges for this rule
      • minTemp

        public double minTemp
        Temperature range for this rule
      • maxTemp

        public double maxTemp
        Temperature range for this rule
      • minRain

        public double minRain
        rainfall range for this rule
      • maxRain

        public double maxRain
        rainfall range for this rule
      • minFlux

        public double minFlux
        river flux range for this rule
      • maxFlux

        public double maxFlux
        river flux range for this rule
      • flexRange

        public boolean flexRange
        is there flexibility in these ranges
      • taperedBid

        public boolean taperedBid
        taper bids as we move away from mid-range
      • vigor

        public int vigor
        how high should this rule bid
      • floraType

        public java.lang.String floraType
        where can this creature live
      • order

        public int order
        when, in the sequence of bids, does this go
      • previewColor

        public java.awt.Color previewColor
        what color should this render as in previews
      • debug

        public boolean debug
        Debug: trace bids from this rule
      • justification

        public java.lang.String justification
        Debug: explain the basis for the last bid
    • Constructor Detail

      • ResourceRule

        public ResourceRule​(java.lang.String name)
        create a new subtype
        Parameters:
        name - of this subtype
    • Method Detail

      • size

        public static int size()
      • iterator

        public static java.util.ListIterator<ResourceRule> iterator()
      • set_attribute

        public void set_attribute​(java.lang.String name,
                                  java.lang.String value)
      • set_attribute

        public void set_attribute​(java.lang.String name,
                                  int value)
      • set_range

        public void set_range​(java.lang.String name,
                              java.lang.String limit,
                              double value)
      • loadRules

        public void loadRules​(java.lang.String file)
        load in resource placement rules
        Parameters:
        file - name of file to be read
      • dump

        public void dump​(java.lang.String prefix)
        dump out a Rule (for debugging)
        Parameters:
        prefix - ... leading blanks Note: subclass should call super.dump() and then add its own output
      • wrongFlora

        public boolean wrongFlora​(java.lang.String floraClass)
        is this rule inapplicable to a particular floral class
        Parameters:
        floraClass - to be checked