Class FantasyPoliticalMapper.Faction

java.lang.Object
squidpony.squidgrid.mapping.FantasyPoliticalMapper.Faction
All Implemented Interfaces:
Serializable
Enclosing class:
FantasyPoliticalMapper

public static class FantasyPoliticalMapper.Faction
extends Object
implements Serializable
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 FakeLanguageGen 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).
See Also:
Serialized Form
  • Field Summary

    Fields 
    Modifier and Type Field Description
    HashSet<String> blockedBiomes
    A HashSet of String keys, where each key is the name of a biome this Faction will never occupy.
    FakeLanguageGen language  
    String name  
    HashSet<String> preferredBiomes
    A HashSet of String keys, where each key is the name of a biome this Faction wants to occupy.
    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.
    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.
    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.
    String shortName  
  • Constructor Summary

    Constructors 
    Constructor Description
    Faction()
    Zero-arg constructor that sets the language to a random FakeLanguageGen (using FakeLanguageGen.randomLanguage(long)), then generates a name/shortName with that FakeLanguageGen, and makes the only blocked biome "Ocean".
    Faction​(FakeLanguageGen language)
    Constructor that sets the language to the specified FakeLanguageGen, then generates a name/shortName with that FakeLanguageGen, and makes the only blocked biome "Ocean".
    Faction​(FakeLanguageGen language, String name)
    Constructor that sets the language to the specified FakeLanguageGen, sets the name and shortName to the specified name, and makes the only blocked biome "Ocean".
    Faction​(FakeLanguageGen language, String name, String shortName)
    Constructor that sets the language to the specified FakeLanguageGen, sets the name to the specified name and the shortName to the specified shortName, and makes the only blocked biome "Ocean".
    Faction​(FakeLanguageGen language, String name, String shortName, String[] preferredBiomes)
    Constructor that sets the language to the specified FakeLanguageGen, 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​(FakeLanguageGen language, String name, String shortName, String[] preferredBiomes, String[] blockedBiomes)
    Constructor that sets the language to the specified FakeLanguageGen, 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​(FakeLanguageGen language, String name, String shortName, String[] preferredBiomes, String[] blockedBiomes, int[] preferredHeight)
    Constructor that sets the language to the specified FakeLanguageGen, 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​(FakeLanguageGen language, String name, String shortName, String[] preferredBiomes, String[] blockedBiomes, int[] preferredHeight, int[] preferredHeat)
    Constructor that sets the language to the specified FakeLanguageGen, 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​(FakeLanguageGen language, String name, String shortName, String[] preferredBiomes, String[] blockedBiomes, int[] preferredHeight, int[] preferredHeat, int[] preferredMoisture)
    Constructor that sets the language to the specified FakeLanguageGen, 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • name

      public String name
    • shortName

      public String shortName
    • language

    • preferredBiomes

      A HashSet 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

      A HashSet 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 FakeLanguageGen (using FakeLanguageGen.randomLanguage(long)), then generates a name/shortName with that FakeLanguageGen, and makes the only blocked biome "Ocean".
    • Faction

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

      public Faction​(FakeLanguageGen language, String name)
      Constructor that sets the language to the specified FakeLanguageGen, sets the name and shortName to the specified name, and makes the only blocked biome "Ocean".
      Parameters:
      language - the FakeLanguageGen 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​(FakeLanguageGen language, String name, String shortName)
      Constructor that sets the language to the specified FakeLanguageGen, sets the name to the specified name and the shortName to the specified shortName, and makes the only blocked biome "Ocean".
      Parameters:
      language - the FakeLanguageGen to use for potentially generating place names
      name - the name of the Faction, such as "The United States of America"
      shortName - the short name of the Faction, such as "America"
    • Faction

      public Faction​(FakeLanguageGen language, String name, String shortName, String[] preferredBiomes)
      Constructor that sets the language to the specified FakeLanguageGen, 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 WorldMapGenerator.BiomeMapper.getBiomeNameTable().
      Parameters:
      language - the FakeLanguageGen to use for potentially generating place names
      name - the 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 WorldMapGenerator.BiomeMapper.getBiomeNameTable() value
    • Faction

      public Faction​(FakeLanguageGen language, String name, String shortName, String[] preferredBiomes, String[] blockedBiomes)
      Constructor that sets the language to the specified FakeLanguageGen, 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 WorldMapGenerator.BiomeMapper.getBiomeNameTable().
      Parameters:
      language - the FakeLanguageGen to use for potentially generating place names
      name - the 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 WorldMapGenerator.BiomeMapper.getBiomeNameTable() value
      blockedBiomes - a String array of biome names that this Faction will never claim; if empty, this Faction may claim oceans
    • Faction

      public Faction​(FakeLanguageGen language, String name, String shortName, String[] preferredBiomes, String[] blockedBiomes, int[] preferredHeight)
      Constructor that sets the language to the specified FakeLanguageGen, 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 WorldMapGenerator.BiomeMapper.getBiomeNameTable().
      Parameters:
      language - the FakeLanguageGen to use for potentially generating place names
      name - the 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 WorldMapGenerator.BiomeMapper.getBiomeNameTable() 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​(FakeLanguageGen language, String name, String shortName, String[] preferredBiomes, String[] blockedBiomes, int[] preferredHeight, int[] preferredHeat)
      Constructor that sets the language to the specified FakeLanguageGen, 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 WorldMapGenerator.BiomeMapper.getBiomeNameTable().
      Parameters:
      language - the FakeLanguageGen to use for potentially generating place names
      name - the 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 WorldMapGenerator.BiomeMapper.getBiomeNameTable() 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​(FakeLanguageGen language, String name, String shortName, String[] preferredBiomes, String[] blockedBiomes, int[] preferredHeight, int[] preferredHeat, int[] preferredMoisture)
      Constructor that sets the language to the specified FakeLanguageGen, 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 WorldMapGenerator.BiomeMapper.getBiomeNameTable().
      Parameters:
      language - the FakeLanguageGen to use for potentially generating place names
      name - the 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 WorldMapGenerator.BiomeMapper.getBiomeNameTable() 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