public static class WorldMapGenerator.SimpleBiomeMapper extends java.lang.Object implements WorldMapGenerator.BiomeMapper
makeBiomes(WorldMapGenerator)
with a WorldMapGenerator that has already produced at least one world map.
3, get biome codes from the biomeCodeData
field, where a code is an int that can be used as an index
into the biomeTable
static field to get a String name for a biome type, or used with an alternate biome
table of your design. Biome tables in this case are 61-element arrays organized into groups of 6 elements, with
the last element reserved for empty space where the map doesn't cover (as with some map projections). Each
group goes from the coldest temperature first to the warmest temperature last in the group. The first group of 6
contains the dryest biomes, the next 6 are medium-dry, the next are slightly-dry, the next slightly-wet, then
medium-wet, then wettest. After this first block of dry-to-wet groups, there is a group of 6 for coastlines, a
group of 6 for rivers, a group of 6 for lakes, a group of 6 for oceans, and then one element for space outside
the map. The last element, with code 60, is by convention the String "Empty", but normally the code should be
enough to tell that a space is off-map. This also assigns moisture codes and heat codes from 0 to 5 for each
cell, which may be useful to simplify logic that deals with those factors.Modifier and Type | Field and Description |
---|---|
int[][] |
biomeCodeData
The heat codes for the analyzed map, from 0 to 5 inclusive, with 0 coldest and 5 hottest.
|
static java.lang.String[] |
biomeTable
The default biome table to use with biome codes from
biomeCodeData . |
static double |
colderValueLower |
static double |
colderValueUpper |
static double |
coldestValueLower |
static double |
coldestValueUpper |
static double |
coldValueLower |
static double |
coldValueUpper |
static double |
drierValueLower |
static double |
drierValueUpper |
static double |
driestValueLower |
static double |
driestValueUpper |
static double |
dryValueLower |
static double |
dryValueUpper |
int[][] |
heatCodeData
The heat codes for the analyzed map, from 0 to 5 inclusive, with 0 coldest and 5 hottest.
|
int[][] |
moistureCodeData
The heat codes for the analyzed map, from 0 to 5 inclusive, with 0 coldest and 5 hottest.
|
static double |
warmerValueLower |
static double |
warmerValueUpper |
static double |
warmestValueLower |
static double |
warmestValueUpper |
static double |
warmValueLower |
static double |
warmValueUpper |
static double |
wetterValueLower |
static double |
wetterValueUpper |
static double |
wettestValueLower |
static double |
wettestValueUpper |
static double |
wetValueLower |
static double |
wetValueUpper |
Constructor and Description |
---|
SimpleBiomeMapper()
Simple constructor; pretty much does nothing.
|
Modifier and Type | Method and Description |
---|---|
int |
getBiomeCode(int x,
int y)
Gets the most relevant biome code for a given x,y point on the map.
|
java.lang.String[] |
getBiomeNameTable()
Gets a String array where biome codes can be used as indices to look up a name for the biome they refer to.
|
int |
getHeatCode(int x,
int y)
Gets a heat code for a given x,y point on a map, usually as an int between 0 and 5 inclusive.
|
int |
getMoistureCode(int x,
int y)
Gets a moisture code for a given x,y point on a map, usually as an int between 0 and 5 inclusive.
|
void |
makeBiomes(WorldMapGenerator world)
Analyzes the last world produced by the given WorldMapGenerator and uses all of its generated information to
assign biome codes for each cell (along with heat and moisture codes).
|
public int[][] heatCodeData
public int[][] moistureCodeData
public int[][] biomeCodeData
public static final double coldestValueLower
public static final double coldestValueUpper
public static final double colderValueLower
public static final double colderValueUpper
public static final double coldValueLower
public static final double coldValueUpper
public static final double warmValueLower
public static final double warmValueUpper
public static final double warmerValueLower
public static final double warmerValueUpper
public static final double warmestValueLower
public static final double warmestValueUpper
public static final double driestValueLower
public static final double driestValueUpper
public static final double drierValueLower
public static final double drierValueUpper
public static final double dryValueLower
public static final double dryValueUpper
public static final double wetValueLower
public static final double wetValueUpper
public static final double wetterValueLower
public static final double wetterValueUpper
public static final double wettestValueLower
public static final double wettestValueUpper
public static final java.lang.String[] biomeTable
biomeCodeData
. Biomes are assigned based on
heat and moisture for the first 36 of 61 elements (coldest to warmest for each group of 6, with the first
group as the dryest and the last group the wettest), then the next 6 are for coastlines (coldest to warmest),
then rivers (coldest to warmest), then lakes (coldest to warmest), then oceans (coldest to warmest), and
lastly a single "biome" for empty space outside the map (meant for projections that don't fill a rectangle).public SimpleBiomeMapper()
makeBiomes(WorldMapGenerator)
before
using fields like biomeCodeData
.public int getBiomeCode(int x, int y)
WorldMapGenerator.BiomeMapper
WorldMapGenerator.BiomeMapper.getBiomeNameTable()
.
Although different classes may define biome codes differently, they should all be able to be used as indices
into the String array returned by getBiomeNameTable().getBiomeCode
in interface WorldMapGenerator.BiomeMapper
x
- the x-coordinate on the mapy
- the y-coordinate on the mapWorldMapGenerator.BiomeMapper.getBiomeNameTable()
public int getHeatCode(int x, int y)
WorldMapGenerator.BiomeMapper
getHeatCode
in interface WorldMapGenerator.BiomeMapper
x
- the x-coordinate on the mapy
- the y-coordinate on the mappublic int getMoistureCode(int x, int y)
WorldMapGenerator.BiomeMapper
getMoistureCode
in interface WorldMapGenerator.BiomeMapper
x
- the x-coordinate on the mapy
- the y-coordinate on the mappublic java.lang.String[] getBiomeNameTable()
getBiomeCode(int, int)
.
This method returns a direct reference to biomeTable
, so modifying the returned array is discouraged
(you should implement WorldMapGenerator.BiomeMapper
using this class as a basis if you want to change its size).getBiomeNameTable
in interface WorldMapGenerator.BiomeMapper
biomeTable
, a String array containing names of biomespublic void makeBiomes(WorldMapGenerator world)
biomeCodeData
and used as indices into biomeTable
or a custom biome table.makeBiomes
in interface WorldMapGenerator.BiomeMapper
world
- a WorldMapGenerator that should have generated at least one map; it may be at any zoomCopyright © Eben Howard 2012–2022. All rights reserved.