biome

package
v0.0.0-...-a30bc99 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Biome

type Biome struct {
	Name                 string   `json:"name"`
	MatchScore           int      `json:"match_score"`
	FaunaPrevalence      int      `json:"fauna_prevalence"`
	FaunaTags            []string `json:"fauna_tags"`
	AltitudeMin          int      `json:"altitude_min"`
	AltitudeMax          int      `json:"altitude_max"`
	TemperatureMin       int      `json:"temperature_min"`
	TemperatureMax       int      `json:"temperature_max"`
	PrecipitationMin     int      `json:"precipitation_min"`
	PrecipitationMax     int      `json:"precipitation_max"`
	Type                 string   `json:"type"`                  // either terrestrial, freshwater, or marine
	VegetationPrevalence int      `json:"vegetation_prevalence"` // 0-99
	VegetationTags       []string `json:"vegetation_tags"`
}

Biome is a biome

func Generate

func Generate(c climate.Climate, r region.Region) (Biome, error)

Generate procedurally generates a biome for a given climate and region

func Load

func Load() ([]Biome, error)

Load returns all predefined species of a given type from a JSON file on disk

func Match

func Match(biomeType string, precipitation int, temperature int, altitude int) (Biome, error)

Match generates a biome for a given biome type, precipitation amount, temperature, and altitude

func (Biome) Score

func (b Biome) Score(biomeType string, precipitation int, temperature int, altitude int) int

Score returns a numeric score for a biome based on selection criteria

type BiomeCriteria

type BiomeCriteria struct {
	Altitude      int
	Precipitation int
	Temperature   int
}

BiomeCriteria is a set of information used for evaluating biomes

type Data

type Data struct {
	Biomes []Biome `json:"biomes"`
}

Data is a structural element to hold biomes when loaded or displayed

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL