QtCraft API C++ classes QML types Handbook

QcCircuitComponents Class

How each kind of component reacts (decision E-336), as decisions on the world before a step. More...

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

Public Types

struct Context
struct Plates

Public Functions

void observed(QcBlockPos pos, QcCircuitPlan &plan) const
bool pistonPowered(QcBlockPos pos, QcSignalState state) const
bool poweredOrQuasi(QcBlockPos pos, quint8 ignoredFaces) const
void react(QcBlockPos pos, QcCircuitPlan &plan)
void replaced(QcBlockPos pos, QcBlockId before, QcBlockId after, QcCircuitPlan &plan) const
void scheduled(QcBlockPos pos, QcCircuitPlan &plan)

Static Public Members

const int burnoutTicks
const int burnoutToggles
const int burnoutWindowTicks
const int comparatorDelayTicks
const int dispenserDelayTicks
const quint8 extendedThisTick
const int observerPulseTicks
const int plateCheckTicks
const int repeaterStepTicks
const quint8 retractedThisTick
const int torchDelayTicks

Detailed Description

A component reacts when a block changes next to it (or next to what powers it) and again when its scheduled tick comes:

Member Function Documentation

void QcCircuitComponents::observed(QcBlockPos pos, QcCircuitPlan &plan) const

An observer at pos saw the block in front of it change: its pulse goes into plan.

bool QcCircuitComponents::pistonPowered(QcBlockPos pos, QcSignalState state) const

Returns whether the piston at pos in state is powered now.

bool QcCircuitComponents::poweredOrQuasi(QcBlockPos pos, quint8 ignoredFaces) const

Returns whether the block at pos is powered through any face but those in ignoredFaces, or (with quasi-connectivity, the world's rule and the block's) through what would power the block above it.

void QcCircuitComponents::react(QcBlockPos pos, QcCircuitPlan &plan)

A block changed near the component at pos: its decisions go into plan.

void QcCircuitComponents::replaced(QcBlockPos pos, QcBlockId before, QcBlockId after, QcCircuitPlan &plan) const

The block before at pos became after: a tripwire hook or wire that is gone tells its lines in plan (decision E-782).

void QcCircuitComponents::scheduled(QcBlockPos pos, QcCircuitPlan &plan)

The scheduled tick of the component at pos came: its decisions go into plan.