Class WorldMapGenerator.SimpleBiomeMapper

java.lang.Object
squidpony.squidgrid.mapping.WorldMapGenerator.SimpleBiomeMapper
All Implemented Interfaces:
WorldMapGenerator.BiomeMapper
Enclosing class:
WorldMapGenerator

public static class WorldMapGenerator.SimpleBiomeMapper
extends Object
implements WorldMapGenerator.BiomeMapper
A way to get biome information for the cells on a map when you only need a single value to describe a biome, such as "Grassland" or "TropicalRainforest".
To use: 1, Construct a SimpleBiomeMapper (constructor takes no arguments). 2, call 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.