Documentation
¶
Index ¶
- Variables
- func ChunkBBox(c *chunk.Chunk) cube.BBox
- func Compare(Op Operator, X, Y any) bool
- func EvalConditions(ChunkPos world.ChunkPos, Origin FeaturePos, Conditions []FeatureCondition, ...) bool
- func EvalPlacementPass(fr FeatureRule, Origin FeaturePos, ChunkPos world.ChunkPos, ...) bool
- func FeatureRandom(x, z int64, ft FeatureType, seed int64) rand.Source
- func PopulateChunk(chunkPos world.ChunkPos, chunk *chunk.Chunk, WGRand *wgrandom.WGRandom)
- func TryAndReplace(allR []ReplaceRule, Pos cube.Pos, c *chunk.Chunk)
- type CoordRange
- type CoordinateEvalOrder
- type DistributionType
- type Feature
- type FeatureCondition
- type FeatureConditionType
- type FeatureDistribution
- type FeaturePos
- type FeatureRule
- type FeatureType
- type NopFeature
- type Operator
- type OreFeature
- type PlacementPassType
- type ReplaceRule
- type TreeFeature
Constants ¶
This section is empty.
Variables ¶
View Source
var FeatureRuleTable []FeatureRule
View Source
var FeatureTable map[string]Feature
Functions ¶
func EvalConditions ¶
func EvalConditions(ChunkPos world.ChunkPos, Origin FeaturePos, Conditions []FeatureCondition, WGRandom *wgrandom.WGRandom) bool
func EvalPlacementPass ¶
func EvalPlacementPass(fr FeatureRule, Origin FeaturePos, ChunkPos world.ChunkPos, r *wgrandom.WGRandom) bool
func FeatureRandom ¶
func FeatureRandom(x, z int64, ft FeatureType, seed int64) rand.Source
func PopulateChunk ¶
func TryAndReplace ¶
func TryAndReplace(allR []ReplaceRule, Pos cube.Pos, c *chunk.Chunk)
Types ¶
type CoordRange ¶
type CoordRange struct {
DistributionType DistributionType
Min, Max int
}
func ConstCoordRange ¶
func ConstCoordRange(Val int) CoordRange
type CoordinateEvalOrder ¶
type CoordinateEvalOrder int
const ( XYZ CoordinateEvalOrder = iota XZY YXZ YZX ZXY ZYX )
type DistributionType ¶
type DistributionType int
const ( UNIFORM DistributionType = iota GAUSSIAN INVERSE_GAUSSIAN TRIANGLE FIXED_GRID JITTERED_GRID )
type Feature ¶
type Feature interface {
Identifier() string
Type() FeatureType
Build(*chunk.Chunk, FeaturePos, *rand.Rand)
}
type FeatureCondition ¶
type FeatureCondition struct {
Type FeatureConditionType
Test string
Operator Operator
Value string
}
type FeatureConditionType ¶
type FeatureConditionType int
const (
TYPE_BIOME_FILTER FeatureConditionType = iota
)
type FeatureDistribution ¶
type FeatureDistribution struct {
Iterations int
ScatterChance wgrandom.Chance
CoordinateEvalOrder CoordinateEvalOrder
X,
Y,
Z CoordRange
}
type FeaturePos ¶
func (FeaturePos) X ¶
func (f FeaturePos) X() int
func (FeaturePos) Y ¶
func (f FeaturePos) Y() int
func (FeaturePos) Z ¶
func (f FeaturePos) Z() int
type FeatureRule ¶
type FeatureRule struct {
Identifier,
Places string
Conditions []FeatureCondition
Distribution FeatureDistribution
PlacementPass PlacementPassType
}
func (FeatureRule) PopulateChunk ¶
type FeatureType ¶
type FeatureType int
const ( TYPE_ORE FeatureType = iota TYPE_AGGREGATE TYPE_SCATTER TYPE_SINGLE_BLOCK TYPE_SEARCH TYPE_TREE TYPE_FOSSIL TYPE_SEQUENCE TYPE_WEIGHED_RANDOM TYPE_NETHER_CARVER TYPE_CAVE_CARVER TYPE_UNDERWATER_CARVER TYPE_NOOP )
type NopFeature ¶
type NopFeature struct {
ID string
}
func (NopFeature) Build ¶
func (f NopFeature) Build(c *chunk.Chunk, fp FeaturePos, _ *rand.Rand)
func (NopFeature) Identifier ¶
func (f NopFeature) Identifier() string
func (NopFeature) Type ¶
func (f NopFeature) Type() FeatureType
type OreFeature ¶
type OreFeature struct {
ID string
ReplaceRule []ReplaceRule
Count int
}
func (OreFeature) Build ¶
func (ore OreFeature) Build(c *chunk.Chunk, f FeaturePos, r *rand.Rand)
func (OreFeature) Identifier ¶
func (ore OreFeature) Identifier() string
func (OreFeature) Type ¶
func (ore OreFeature) Type() FeatureType
type PlacementPassType ¶
type PlacementPassType int
const ( SURFACE_PASS PlacementPassType = iota UNDERGROUND_PASS )
type ReplaceRule ¶
type TreeFeature ¶
func (TreeFeature) Build ¶
func (tree TreeFeature) Build(c *chunk.Chunk, f FeaturePos, _ *rand.Rand)
func (TreeFeature) Identifier ¶
func (tree TreeFeature) Identifier() string
func (TreeFeature) Type ¶
func (tree TreeFeature) Type() FeatureType
Click to show internal directories.
Click to hide internal directories.