QtCraft API C++ classes QML types Handbook

QcWetlandPattern Class

The surface of a wetland (decision E-661): irregular pools of water where a seeded noise lies below the quantile of the style's water share, the deepest part of them a block deeper, a band of the bottom block (mud) around them, grass between. More...

Header: #include <worldgen/villages/QcWetlandPattern.h>

Public Types

enum class Cover { Grass, Mud, Water, DeepWater }

Public Functions

QcWetlandPattern(quint64 seed)
QcWetlandPattern::Cover coverAt(const QcVillagePlan::Wetland &wetland, int x, int z) const
bool floatingPlantAt(const QcVillageStyle::Wetland &settings, int x, int z) const
bool plantAt(const QcVillageStyle::Wetland &settings, int x, int z) const

Detailed Description

Under pieces and boardwalks the ground is mud (no pools), so posts stand on it. A pure function of the seed, the plan and the column, so every chunk sees the same pattern in any order. Thread-safe.

Member Type Documentation

enum class QcWetlandPattern::Cover

What covers a column of the flat wetland.

ConstantValueDescription
QcWetlandPattern::Cover::Grass0Grass between the pools.
QcWetlandPattern::Cover::Mud1The bottom block: around the pools, under pieces and boardwalks.
QcWetlandPattern::Cover::Water2A pool.
QcWetlandPattern::Cover::DeepWater3The deepest part of a pool, a block deeper.

Member Function Documentation

[explicit] QcWetlandPattern::QcWetlandPattern(quint64 seed)

Seeds the pool noise and the plant draws from seed.

QcWetlandPattern::Cover QcWetlandPattern::coverAt(const QcVillagePlan::Wetland &wetland, int x, int z) const

Returns what covers the flat wetland at the column x, z.

bool QcWetlandPattern::floatingPlantAt(const QcVillageStyle::Wetland &settings, int x, int z) const

Returns whether the floating plant of settings (if the style has one) lies on the water of the pool column x, z by its chance.

bool QcWetlandPattern::plantAt(const QcVillageStyle::Wetland &settings, int x, int z) const

Returns whether the plant of settings (if the style has one) grows at the column x, z by its chance, a pure function of the column.