QtCraft API C++ classes QML types Handbook

QcSignalState Struct

What the signal engine reads from one block state, decoded once from the state's properties so that circuits never compare strings while they run (decision E-335). More...

Header: #include <server/signal/QcSignalTable.h>

Public Variables

bool conductor
quint8 delay
std::optional<QcBlockFace> facing
QcSignalKind kind
bool locked
QcPistonMobility mobility
bool on
quint8 power
std::array<QcDustSide, 4> sides
bool strongPowersAbove
bool subtract
enum class QcDustSide { None, Side, Up }

Detailed Description

Indexed by block state id.

Member Variable Documentation

bool QcSignalState::conductor

A full solid opaque block that passes power (stone, lamps), whatever its kind.

quint8 QcSignalState::delay

Repeaters: their delay in steps.

std::optional<QcBlockFace> QcSignalState::facing

Repeaters and pistons: where they point; torches, levers and buttons: towards the block they hang on (down on the floor, up at the ceiling).

QcSignalKind QcSignalState::kind

What kind of component it is.

bool QcSignalState::locked

Repeaters: locked by a side; hoppers: not enabled (powered).

QcPistonMobility QcSignalState::mobility

How a piston moves the block.

bool QcSignalState::on

Levers, buttons, plates, repeaters, comparators and observers: powered; torches and lamps: the lit block; pistons: extended; openers: open; piston heads: sticky; dispensers: triggered.

quint8 QcSignalState::power

Dust and comparators: their strength. Sources: what they emit while on (0 while off).

std::array<QcDustSide, 4> QcSignalState::sides

Dust connections towards north, east, south and west.

bool QcSignalState::strongPowersAbove

Torches: whether a lit one strongly powers a conductor above it (QcSignalDefinition::strongPowersAbove).

bool QcSignalState::subtract

Comparators in subtract mode.

Related Non-Members

enum class QcDustSide

How a side of a Signal Dust block connects: not at all, flat (also down a block), or up the neighbouring block.

ConstantValueDescription
QcSignalState::QcDustSide::None0Not connected.
QcSignalState::QcDustSide::Side1Flat to the side (also down a block).
QcSignalState::QcDustSide::Up2Up the neighbouring block.