QtCraft API C++ classes QML types Handbook

QcVegetationTable Class

One layer of a biome's vegetation (decision E-814) resolved to block ids: a weighted choice shared by the world generator and bone meal. More...

Header: #include <common/world/QcVegetationTable.h>

Public Types

struct Plant
struct Resolved

Public Functions

QcVegetationTable()
bool isEmpty() const
const QcVegetationTable::Plant &pick(double random) const
const QList<QcVegetationTable::Plant> &plants() const

Static Public Members

QcVegetationTable::Resolved resolve(const QcContentRegistry &content, const QcVegetationLayer &layer)

Detailed Description

Immutable after construction.

Member Function Documentation

[constexpr noexcept default] QcVegetationTable::QcVegetationTable()

Default-constructs an instance of QcVegetationTable.

bool QcVegetationTable::isEmpty() const

Returns whether the table holds no plant.

const QcVegetationTable::Plant &QcVegetationTable::pick(double random) const

Returns the plant a random value in [0, 1) chooses by weight; the table must not be empty.

const QList<QcVegetationTable::Plant> &QcVegetationTable::plants() const

Returns the plants in the order of the layer.

[static] QcVegetationTable::Resolved QcVegetationTable::resolve(const QcContentRegistry &content, const QcVegetationLayer &layer)

Returns the table of layer with the block ids of content and the names left out.