QtCraft API C++ classes QML types Handbook

QcVillageStyles Class

The village styles of the content (decision E-403), resolved once per world generator: which style a biome builds in, with every piece's structure, palette swaps, beds and workstations. More...

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

Public Types

struct Spots

Public Functions

QcVillageStyles(const QcContentRegistry &content)
const QcVillageBlocks &blocks() const
const QcVillageStyle *forBiome(const QcBiomeDefinition &biome) const
bool isEmpty() const
const QcVillageStyle *named(const QString &name) const
QcVillageStyles::Spots spotsOf(const QcStructure &structure) const
const QStringList &warnings() const

Detailed Description

Immutable after construction, so the generator's threads share it.

Member Function Documentation

[explicit] QcVillageStyles::QcVillageStyles(const QcContentRegistry &content)

Resolves the village styles of content. Styles with an unknown structure or block are left out with a warning (warnings()).

const QcVillageBlocks &QcVillageStyles::blocks() const

Returns the block states the village counts.

const QcVillageStyle *QcVillageStyles::forBiome(const QcBiomeDefinition &biome) const

Returns the style of biome: the one that names it, else the fallback; null for biomes without villages or when no style fits.

bool QcVillageStyles::isEmpty() const

Returns whether no style resolved.

const QcVillageStyle *QcVillageStyles::named(const QString &name) const

Returns the style called name; null when there is none.

QcVillageStyles::Spots QcVillageStyles::spotsOf(const QcStructure &structure) const

Returns the spots of structure, in its local cells (the last bell found if it has several).

const QStringList &QcVillageStyles::warnings() const

Returns what resolving the styles left out or changed.