QtCraft API C++ classes QML types Handbook

QcMineshaftBlocks Struct

The blocks a mine shaft places (decision E-570), resolved once from QcMineshaftSettings, and which block states the builder treats as open (where a floor gets planks and a pillar goes on down) or liquid. More...

Header: #include <worldgen/mineshafts/QcMineshaftBlocks.h>

Public Types

struct Resolved
enum class Side { North, East, South, West }

Public Functions

bool falls(QcBlockId block) const
bool isFoliage(QcBlockId block) const
bool isLiquid(QcBlockId block) const
bool isOpen(QcBlockId block) const

Public Variables

int areaX
int areaY
int areaZ
QcBlockId cobweb
std::vector<bool> falling
std::vector<bool> foliage
std::array<QcBlockId, 4> ladders
std::array<QcBlockId, 4> lights
std::vector<bool> liquid
std::vector<bool> open
QcBlockId planks
QcBlockId post
QcBlockId railEastWest
QcBlockId railNorthSouth
std::array<QcBlockId, 4> railsUp
QcBlockId seal
QcBlockId spawner

Static Public Members

bool flagOf(const std::vector<bool> &table, QcBlockId block)
QcMineshaftBlocks::Resolved resolve(const QcMineshaftSettings &settings, const QcContentRegistry &content)
QcMineshaftBlocks::Side sideOf(int dx, int dz)
std::size_t slotOf(QcMineshaftBlocks::Side side)

Detailed Description

Sides are indexed north, east, south, west.

Member Type Documentation

enum class QcMineshaftBlocks::Side

A side of a cell; the value is its index in the arrays by side (lights, ladders, railsUp) and the number of quarter turns from north.

ConstantValueDescription
QcMineshaftBlocks::Side::North0Towards -z.
QcMineshaftBlocks::Side::East1Towards +x.
QcMineshaftBlocks::Side::South2Towards +z.
QcMineshaftBlocks::Side::West3Towards -x.

Member Function Documentation

bool QcMineshaftBlocks::falls(QcBlockId block) const

Returns whether block falls (sand, gravel).

[static] bool QcMineshaftBlocks::flagOf(const std::vector<bool> &table, QcBlockId block)

Returns the entry of block in table (one per runtime id of the content).

bool QcMineshaftBlocks::isFoliage(QcBlockId block) const

Returns whether block is foliage (solid but not opaque).

bool QcMineshaftBlocks::isLiquid(QcBlockId block) const

Returns whether block is a liquid.

bool QcMineshaftBlocks::isOpen(QcBlockId block) const

Returns whether block offers nothing to stand on (not solid, or liquid).

[static] QcMineshaftBlocks::Resolved QcMineshaftBlocks::resolve(const QcMineshaftSettings &settings, const QcContentRegistry &content)

Returns the blocks of settings resolved in content; none when one is unknown, with a warning each.

[static] QcMineshaftBlocks::Side QcMineshaftBlocks::sideOf(int dx, int dz)

Returns the side of the unit step dx, dz.

[static constexpr] std::size_t QcMineshaftBlocks::slotOf(QcMineshaftBlocks::Side side)

Returns the index of side in the arrays by side and its quarter turns from north.

Member Variable Documentation

QcBlockId QcMineshaftBlocks::cobweb

The cobweb block.

QcBlockId QcMineshaftBlocks::planks

The planks of floors over open cells, support beams and the entrances' platforms.

QcBlockId QcMineshaftBlocks::post

The posts of supports and pillars.

std::array<QcBlockId, 4> QcMineshaftBlocks::railsUp

Rails rising towards the side (an inclined entrance's steps, decision E-895).

QcBlockId QcMineshaftBlocks::seal

The block that replaces liquid beside a corridor and sand or gravel above it.

QcBlockId QcMineshaftBlocks::spawner

The spawner block.