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
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:
- a Signal Torch goes out or lights 2 ticks after its block's power changed; going out 8 times within 60 ticks burns it out for 160 ticks (it fizzles);
- a Signal Repeater switches after 2 ticks per delay step and always gives a pulse of at least its delay; a powered repeater pointing at its side locks it;
- a Signal Lamp lights at once and goes dark
offDelayTicksafter losing power; - an opener follows rising and falling power, so players can still use it in between;
- a piston extends or retracts at once (BUD: with quasi-connectivity it is also powered through the block above it, but only finds out when something next to it changes);
- buttons spring back after
pulseTicks, plates when nothing stands on them any more; - a Signal Comparator recomputes its output 2 ticks after its inputs changed: the back input (or the reading of a container or readable block behind it, also through one conductor) compared with or reduced by the strongest side input (decision E-343);
- a Signal Observer turns on 2 ticks after the block in front of it changed and off 2 ticks later;
- a Signal Hopper is locked while it gets any power;
- a Signal Dispenser or dropper notes rising power (also quasi-connectivity, like a piston) and ejects an item 4 ticks later (decision E-345);
- a rail slot (powered and activator rails) is powered at once while it or a rail of the same block within its reach along the line gets power; a change at one rail decides all rails within reach of it (decision E-384).
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.