QtCraft API C++ classes QML types Handbook

QcVillageBlocks Class

The block states a village counts (decision E-403): bed heads (blocks with bed, part head), workstations (QcVillageSettings::workstations, every state of the block) and the meeting point block (QcVillageSettings::bell). More...

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

Public Functions

QcVillageBlocks(const QcContentRegistry &content)
bool isBedHead(QcBlockId block) const
bool isBell(QcBlockId block) const
bool matters(QcBlockId block) const
const QStringList &warnings() const
QString workstationKind(QcBlockId block) const

Detailed Description

Shared by the generator's styles and the server's village state.

Member Function Documentation

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

Reads the states of content and its village settings. Unknown workstation blocks are left out with a warning (warnings()).

bool QcVillageBlocks::isBedHead(QcBlockId block) const

Returns whether block is the head part of a bed.

bool QcVillageBlocks::isBell(QcBlockId block) const

Returns whether block is a state of the meeting point block.

bool QcVillageBlocks::matters(QcBlockId block) const

Returns whether the village state cares about block at all: a bed head or a workstation (the meeting point block does not count).

const QStringList &QcVillageBlocks::warnings() const

Returns the warnings of the construction (unknown workstation blocks).

QString QcVillageBlocks::workstationKind(QcBlockId block) const

Returns the kind of work of the workstation state block; empty for other blocks.