Interface WorldMapView
- All Known Implementing Classes:
BlendedWorldMapView, DetailedWorldMapView, SimpleWorldMapView, UnrealisticWorldMapView
public interface WorldMapView
Takes a
The main implementations of this so far are
WorldMapGenerator, such as a LocalMap, RotatingGlobeMap, or StretchWorldMap,
and wraps it so that you can call generate() on this to coordinate calls to
WorldMapGenerator.generate() and BiomeMapper.makeBiomes(WorldMapGenerator).
For extra convenience, you can get a possible interpretation of how the generated world would look by calling
show(), which returns a 2D array of ints as RGBA8888 colors.
The main implementations of this so far are
DetailedWorldMapView and BlendedWorldMapView, which use
a BiomeMapper.DetailedBiomeMapper and a BiomeMapper.BlendedBiomeMapper, respectively. The Blended types tend to be easier to
use and produce smoother transitions between biomes; they are preferred. There is also
UnrealisticWorldMapView, which is meant for debugging world maps to find any flaws in a particular generator.-
Method Summary
Modifier and TypeMethodDescriptionvoidalter()Partly-randomizes the colors used for biomes.voidgenerate()voidgenerate(float landMod, float heatMod) voidgenerate(long seedA, long seedB, float landMod, float heatMod) int[][]int[][]intintgetWidth()getWorld()voidvoidinitialize(float hue, float saturation, float brightness, float contrast) Initializes the color tables this uses for all biomes, but allows rotating all hues and adjusting brightness/saturation/contrast to produce maps of non-Earth-like planets.voidmatch(int... similarColors) Initializes the colors to use in some combination for all biomes, without regard for what the biome really is.voidmatch(long seed, int... similarColors) Initializes the colors to use in some combination for all biomes, without regard for what the biome really is.voidsetBiomeMapper(BiomeMapper biomeMapper) voidsetWorld(WorldMapGenerator world) int[][]show()After callinggenerate(), you can call this to assign values togetColorMap()andgetColorMapOklab().
-
Method Details
-
getWidth
int getWidth() -
getHeight
int getHeight() -
getColorMap
int[][] getColorMap() -
getColorMapOklab
int[][] getColorMapOklab() -
getBiomeMapper
BiomeMapper getBiomeMapper() -
setBiomeMapper
-
getWorld
WorldMapGenerator getWorld() -
setWorld
-
initialize
void initialize() -
initialize
void initialize(float hue, float saturation, float brightness, float contrast) Initializes the color tables this uses for all biomes, but allows rotating all hues and adjusting brightness/saturation/contrast to produce maps of non-Earth-like planets.- Parameters:
hue- hue rotation; 0.0 and 1.0 are no rotation, and 0.5 is maximum rotationsaturation- added to the saturation of a biome color; usually close to 0.0, always between -1 and 1brightness- added to the lightness of a biome color; often close to 0.0, always between -1 and 1contrast- multiplies the darkening factor for the dark sections of biomes; typically very close to 1
-
alter
void alter()Partly-randomizes the colors used for biomes. This may request random numbers from the FlowRandom inthe WorldMapGenerator. This should map similar colors in the input color table, like varieties of dark green forest, into similar output colors. It will not change color 60 (empty space), but will change everything else. Typically, colors like white ice will still map to white, and different shades of ocean blue will become different shades of some color (which could still be some sort of blue). This can be a useful alternative toinitialize(float, float, float, float), because that method hue-rotates all colors by the same amount, while this method adjusts each input hue differently and based on their original value. You may want to callinitialize()(either with no arguments or with four) before each call to this, because changes this makes to the color table would be read back the second time this is called without reinitialization. -
match
void match(int... similarColors) Initializes the colors to use in some combination for all biomes, without regard for what the biome really is. There should be at least one packed int Oklab color given in similarColors, but there can be many of them. This type of color can be any of the color constants fromDescriptiveColor, may be produced byDescriptiveColor.describeOklab(String), or might be made manually, in advanced cases, withDescriptiveColor.limitToGamut(int, int, int)and specifying the L, A, and B channels.- Parameters:
similarColors- an array or vararg of packed int Oklab colors with at least one element
-
match
void match(long seed, int... similarColors) Initializes the colors to use in some combination for all biomes, without regard for what the biome really is. There should be at least one packed int Oklab color given in similarColors, but there can be many of them. This type of color can be any of the color constants fromDescriptiveColor, may be produced byDescriptiveColor.describeOklab(String), or might be made manually, in advanced cases, withDescriptiveColor.limitToGamut(int, int, int)and specifying the L, A, and B channels.- Parameters:
seed- any long; used to determine how colors are matched to biomessimilarColors- an array or vararg of packed int Oklab colors with at least one element
-
generate
void generate() -
generate
void generate(float landMod, float heatMod) -
generate
void generate(long seedA, long seedB, float landMod, float heatMod) -
show
int[][] show()After callinggenerate(), you can call this to assign values togetColorMap()andgetColorMapOklab(). This method returns the RGBA colorMap, but it assigns to colorMapOklab at the same time, so you can use the Oklab colors with methods likeDescriptiveColor.lighten(int, float)andDescriptiveColor.lerpColors(int, int, float).- Returns:
- the RGBA8888 colorMap
-