Class PoliticalMapper.Faction

java.lang.Object
com.github.yellowstonegames.world.PoliticalMapper.Faction
Enclosing class:
PoliticalMapper

public static class PoliticalMapper.Faction extends Object
Represents a group that claims territory on a world-map, such as a nation. Each Faction has a name, a short name that may be the same as the regular name, a Language that would be used to generate place names in that Faction's territory, and a number of (possibly null) arrays and Sets that represent what terrains this Faction wants to claim and which it will avoid (e.g. elves may prefer claiming forests, while frost giants won't claim anywhere that's even remotely warm). Humans in all-human settings probably won't have especially restrictive preferences, but the technology they have already mastered may only be applicable in certain areas, like a height of 4 (shoreline) for seafaring groups, or preferredBiomes that include "Grassland" for equestrians.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    com.github.tommyettinger.ds.ObjectSet<String>
    An ObjectSet of String keys, where each key is the name of a biome this Faction will never occupy.
    com.github.yellowstonegames.text.Language
    What Language to use to generate place names and the names of nations.
    The (typically longer) formal name of the Faction, such as "The United States of America" or "The Noble Fiefdom of Harjalia".
    com.github.tommyettinger.ds.ObjectSet<String>
    An ObjectSet of String keys, where each key is the name of a biome this Faction wants to occupy.
    int[]
    An int array of heat codes that this Faction prefers; typically a 6-code scale is used where 0, 1, and 2 are cold and getting progressively warmer, while 3, 4, and 5 are warm to warmest.
    int[]
    An int array of height codes that this Faction prefers; 0, 1, 2, and 3 are all oceans, while 4 is shoreline or low-lying land and higher numbers (up to 8, inclusive) are used for increasing elevations.
    int[]
    An int array of moisture codes that this Faction prefers; typically a 6-code scale is used where 0, 1, and 2 are dry and getting progressively more precipitation, while 3, 4, and 5 are wet to wettest.
    The short name of the Faction, such as "America" or "Harjalia".
  • Constructor Summary

    Constructors
    Constructor
    Description
    Zero-arg constructor that sets the language to a random Language (using Language.randomLanguage(long)), then generates a name/shortName with that Language, and makes the only blocked biome "Ocean".
    Faction(com.github.yellowstonegames.text.Language language)
    Constructor that sets the language to the specified Language, then generates a name/shortName with that Language, and makes the only blocked biome "Ocean".
    Faction(com.github.yellowstonegames.text.Language language, String name)
    Constructor that sets the language to the specified Language, sets the name and shortName to the specified name, and makes the only blocked biome "Ocean".
    Faction(com.github.yellowstonegames.text.Language language, String name, String shortName)
    Constructor that sets the language to the specified Language, sets the name to the specified name and the shortName to the specified shortName, and makes the only blocked biome "Ocean".
    Faction(com.github.yellowstonegames.text.Language language, String name, String shortName, String[] preferredBiomes)
    Constructor that sets the language to the specified Language, sets the name to the specified name and the shortName to the specified shortName, sets the preferredBiomes to be a Set containing the given Strings in preferredBiomes, and makes the only blocked biome "Ocean".
    Faction(com.github.yellowstonegames.text.Language language, String name, String shortName, String[] preferredBiomes, String[] blockedBiomes)
    Constructor that sets the language to the specified Language, sets the name to the specified name and the shortName to the specified shortName, sets the preferredBiomes to be a Set containing the given Strings in preferredBiomes, and sets the blocked biomes to be a Set containing exactly the given Strings in blockedBiomes.
    Faction(com.github.yellowstonegames.text.Language language, String name, String shortName, String[] preferredBiomes, String[] blockedBiomes, int[] preferredHeight)
    Constructor that sets the language to the specified Language, sets the name to the specified name and the shortName to the specified shortName, sets the preferredBiomes to be a Set containing the given Strings in preferredBiomes, sets the blocked biomes to be a Set containing exactly the given Strings in blockedBiomes, and sets the preferred height codes to the ints in preferredHeight (with 4 being sea level and 8 being the highest peaks).
    Faction(com.github.yellowstonegames.text.Language language, String name, String shortName, String[] preferredBiomes, String[] blockedBiomes, int[] preferredHeight, int[] preferredHeat)
    Constructor that sets the language to the specified Language, sets the name to the specified name and the shortName to the specified shortName, sets the preferredBiomes to be a Set containing the given Strings in preferredBiomes, sets the blocked biomes to be a Set containing exactly the given Strings in blockedBiomes, sets the preferred height codes to the ints in preferredHeight (with 4 being sea level and 8 being the highest peaks), and sets the preferred heat codes to the ints in preferredHeat (with the exact values depending on the BiomeMapper, but usually 0-5 range from coldest to hottest).
    Faction(com.github.yellowstonegames.text.Language language, String name, String shortName, String[] preferredBiomes, String[] blockedBiomes, int[] preferredHeight, int[] preferredHeat, int[] preferredMoisture)
    Constructor that sets the language to the specified Language, sets the name to the specified name and the shortName to the specified shortName, sets the preferredBiomes to be a Set containing the given Strings in preferredBiomes, sets the blocked biomes to be a Set containing exactly the given Strings in blockedBiomes, sets the preferred height codes to the ints in preferredHeight (with 4 being sea level and 8 being the highest peaks), sets the preferred heat codes to the ints in preferredHeat (with the exact values depending on the BiomeMapper, but usually 0-5 range from coldest to hottest), and sets the preferred moisture codes to the ints in preferredMoisture (withe the exact values depending on the BiomeMapper, but usually 0-5 range from driest to wettest).
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
     
    int
     
     

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • name

      public String name
      The (typically longer) formal name of the Faction, such as "The United States of America" or "The Noble Fiefdom of Harjalia".
    • shortName

      public String shortName
      The short name of the Faction, such as "America" or "Harjalia".
    • language

      public com.github.yellowstonegames.text.Language language
      What Language to use to generate place names and the names of nations.
    • preferredBiomes

      public com.github.tommyettinger.ds.ObjectSet<String> preferredBiomes
      An ObjectSet of String keys, where each key is the name of a biome this Faction wants to occupy. May be null if no biomes are specifically preferred.
    • blockedBiomes

      public com.github.tommyettinger.ds.ObjectSet<String> blockedBiomes
      An ObjectSet of String keys, where each key is the name of a biome this Faction will never occupy. May be null if all biomes are available, but unless this is specified in a constructor, the default will be to consider "Ocean" blocked.
    • preferredHeight

      public int[] preferredHeight
      An int array of height codes that this Faction prefers; 0, 1, 2, and 3 are all oceans, while 4 is shoreline or low-lying land and higher numbers (up to 8, inclusive) are used for increasing elevations.
    • preferredHeat

      public int[] preferredHeat
      An int array of heat codes that this Faction prefers; typically a 6-code scale is used where 0, 1, and 2 are cold and getting progressively warmer, while 3, 4, and 5 are warm to warmest.
    • preferredMoisture

      public int[] preferredMoisture
      An int array of moisture codes that this Faction prefers; typically a 6-code scale is used where 0, 1, and 2 are dry and getting progressively more precipitation, while 3, 4, and 5 are wet to wettest.
  • Constructor Details

    • Faction

      public Faction()
      Zero-arg constructor that sets the language to a random Language (using Language.randomLanguage(long)), then generates a name/shortName with that Language, and makes the only blocked biome "Ocean".
    • Faction

      public Faction(com.github.yellowstonegames.text.Language language)
      Constructor that sets the language to the specified Language, then generates a name/shortName with that Language, and makes the only blocked biome "Ocean".
      Parameters:
      language - the Language to use for generating the name of the Faction and potentially place names
    • Faction

      public Faction(com.github.yellowstonegames.text.Language language, String name)
      Constructor that sets the language to the specified Language, sets the name and shortName to the specified name, and makes the only blocked biome "Ocean".
      Parameters:
      language - the Language to use for potentially generating place names
      name - the name of the Faction, such as "The United States of America"; will also be the shortName
    • Faction

      public Faction(com.github.yellowstonegames.text.Language language, String name, String shortName)
      Constructor that sets the language to the specified Language, sets the name to the specified name and the shortName to the specified shortName, and makes the only blocked biome "Ocean".
      Parameters:
      language - the Language to use for potentially generating place names
      name - the formal name of the Faction, such as "The United States of America"
      shortName - the short name of the Faction, such as "America"
    • Faction

      public Faction(com.github.yellowstonegames.text.Language language, String name, String shortName, String[] preferredBiomes)
      Constructor that sets the language to the specified Language, sets the name to the specified name and the shortName to the specified shortName, sets the preferredBiomes to be a Set containing the given Strings in preferredBiomes, and makes the only blocked biome "Ocean". The exact String names that are viable for biomes can be obtained from a BiomeMapper with BiomeMapper.getBiomeTable(), or from the constants ending in "_BIOME" in Biome.
      Parameters:
      language - the Language to use for potentially generating place names
      name - the formal name of the Faction, such as "The United States of America"
      shortName - the short name of the Faction, such as "America"
      preferredBiomes - a String array of biome names that this Faction prefers, typically taken from a BiomeMapper's BiomeMapper.getBiomeTable() value
    • Faction

      public Faction(com.github.yellowstonegames.text.Language language, String name, String shortName, String[] preferredBiomes, String[] blockedBiomes)
      Constructor that sets the language to the specified Language, sets the name to the specified name and the shortName to the specified shortName, sets the preferredBiomes to be a Set containing the given Strings in preferredBiomes, and sets the blocked biomes to be a Set containing exactly the given Strings in blockedBiomes. The exact String names that are viable for biomes can be obtained from a BiomeMapper with BiomeMapper.getBiomeTable().
      Parameters:
      language - the Language to use for potentially generating place names
      name - the formal name of the Faction, such as "The United States of America"
      shortName - the short name of the Faction, such as "America"
      preferredBiomes - a String array of biome names that this Faction prefers, typically taken from a BiomeMapper's BiomeMapper.getBiomeTable() value
      blockedBiomes - a String array of biome names that this Faction will never claim; if empty, this Faction may claim oceans
    • Faction

      public Faction(com.github.yellowstonegames.text.Language language, String name, String shortName, String[] preferredBiomes, String[] blockedBiomes, int[] preferredHeight)
      Constructor that sets the language to the specified Language, sets the name to the specified name and the shortName to the specified shortName, sets the preferredBiomes to be a Set containing the given Strings in preferredBiomes, sets the blocked biomes to be a Set containing exactly the given Strings in blockedBiomes, and sets the preferred height codes to the ints in preferredHeight (with 4 being sea level and 8 being the highest peaks). The exact String names that are viable for biomes can be obtained from a BiomeMapper with BiomeMapper.getBiomeTable().
      Parameters:
      language - the Language to use for potentially generating place names
      name - the formal name of the Faction, such as "The United States of America"
      shortName - the short name of the Faction, such as "America"
      preferredBiomes - a String array of biome names that this Faction prefers, typically taken from a BiomeMapper's BiomeMapper.getBiomeTable() value
      blockedBiomes - a String array of biome names that this Faction will never claim; if empty, this Faction may claim oceans
      preferredHeight - an int array of height codes this Faction prefers to claim; 4 is sea level and 8 is highest
    • Faction

      public Faction(com.github.yellowstonegames.text.Language language, String name, String shortName, String[] preferredBiomes, String[] blockedBiomes, int[] preferredHeight, int[] preferredHeat)
      Constructor that sets the language to the specified Language, sets the name to the specified name and the shortName to the specified shortName, sets the preferredBiomes to be a Set containing the given Strings in preferredBiomes, sets the blocked biomes to be a Set containing exactly the given Strings in blockedBiomes, sets the preferred height codes to the ints in preferredHeight (with 4 being sea level and 8 being the highest peaks), and sets the preferred heat codes to the ints in preferredHeat (with the exact values depending on the BiomeMapper, but usually 0-5 range from coldest to hottest). The exact String names that are viable for biomes can be obtained from a BiomeMapper with BiomeMapper.getBiomeTable().
      Parameters:
      language - the Language to use for potentially generating place names
      name - the formal name of the Faction, such as "The United States of America"
      shortName - the short name of the Faction, such as "America"
      preferredBiomes - a String array of biome names that this Faction prefers, typically taken from a BiomeMapper's BiomeMapper.getBiomeTable() value
      blockedBiomes - a String array of biome names that this Faction will never claim; if empty, this Faction may claim oceans
      preferredHeight - an int array of height codes this Faction prefers to claim; 4 is sea level and 8 is highest
      preferredHeat - an int array of heat codes this Faction prefers to claim; typically 0 is coldest and 5 is hottest
    • Faction

      public Faction(com.github.yellowstonegames.text.Language language, String name, String shortName, String[] preferredBiomes, String[] blockedBiomes, int[] preferredHeight, int[] preferredHeat, int[] preferredMoisture)
      Constructor that sets the language to the specified Language, sets the name to the specified name and the shortName to the specified shortName, sets the preferredBiomes to be a Set containing the given Strings in preferredBiomes, sets the blocked biomes to be a Set containing exactly the given Strings in blockedBiomes, sets the preferred height codes to the ints in preferredHeight (with 4 being sea level and 8 being the highest peaks), sets the preferred heat codes to the ints in preferredHeat (with the exact values depending on the BiomeMapper, but usually 0-5 range from coldest to hottest), and sets the preferred moisture codes to the ints in preferredMoisture (withe the exact values depending on the BiomeMapper, but usually 0-5 range from driest to wettest). The exact String names that are viable for biomes can be obtained from a BiomeMapper with BiomeMapper.getBiomeTable().
      Parameters:
      language - the Language to use for potentially generating place names
      name - the formal name of the Faction, such as "The United States of America"
      shortName - the short name of the Faction, such as "America"
      preferredBiomes - a String array of biome names that this Faction prefers, typically taken from a BiomeMapper's BiomeMapper.getBiomeTable() value
      blockedBiomes - a String array of biome names that this Faction will never claim; if empty, this Faction may claim oceans
      preferredHeight - an int array of height codes this Faction prefers to claim; 4 is sea level and 8 is highest
      preferredHeat - an int array of heat codes this Faction prefers to claim; typically 0 is coldest and 5 is hottest
      preferredMoisture - an int array of moisture codes this Faction prefers to claim; typically 0 is driest and 5 is wettest
  • Method Details