QtCraft API C++ classes QML types Handbook

QcSignalDefinition Struct

The Signal Dust part of a block (the "signal" object, decision E-333): its kind and the numbers that tune it. More...

Header: #include <common/content/blockbehaviour/QcSignalDefinition.h>

Public Functions

bool isCircuitPart() const
bool isComponent() const
bool isUsable() const

Public Variables

bool active
bool conducts
QString counterpart
bool detectsCarts
bool detectsItems
QString head
int hitTicks
QcNoteInstruments instruments
QcSignalKind kind
QcPistonMobility mobility
int offDelayTicks
int power
int pulseTicks
int pushLimit
bool quasiConnectivity
int railReach
QString readProperty
QcComparatorReading reading
bool sticky
bool strongPowersAbove
int stuckHitTicks
bool usesItems
int wireReach

Static Public Members

const int maxInstruments
const int maxPower
const int maxPulseTicks
const int maxPushLimit
const int maxRailReach
const int maxWireReach
const int noteCount

Detailed Description

Only kind reaches the client; the rest is server side only.

Member Function Documentation

bool QcSignalDefinition::isCircuitPart() const

Returns whether the block exists for circuits (all components but openers, which are doors and gates first).

bool QcSignalDefinition::isComponent() const

Returns whether the block takes part in circuits (it has a kind).

bool QcSignalDefinition::isUsable() const

Returns whether using the block does something (switching, setting the delay, a note) instead of placing against it. Comparators switch between comparing and subtracting.

Member Variable Documentation

bool QcSignalDefinition::conducts

Whether a full solid block passes power through (strongly and weakly powered blocks). Lamps and stone conduct; pistons do not.

bool QcSignalDefinition::detectsCarts

Plates: only minecarts press it (a detector rail, decision E-385).

bool QcSignalDefinition::detectsItems

Plates: any entity (items, armour stands) presses it, not only players and creatures.

QString QcSignalDefinition::head

Pistons: the block of the extended head (facing like the piston, sticky from the piston).

QcNoteInstruments QcSignalDefinition::instruments

Note blocks: their instruments.

QcSignalKind QcSignalDefinition::kind

Kind of circuit part ("type"); None for blocks outside circuits.

const int QcSignalDefinition::maxInstruments

Note blocks: most entries of each instrument map (QcNoteInstruments).

const int QcSignalDefinition::maxPower

Highest signal strength.

const int QcSignalDefinition::maxPulseTicks

Longest pulseTicks, offDelayTicks, stuckHitTicks and hitTicks.

const int QcSignalDefinition::maxPushLimit

Largest pushLimit.

const int QcSignalDefinition::maxRailReach

Largest railReach.

const int QcSignalDefinition::maxWireReach

Largest wireReach.

QcPistonMobility QcSignalDefinition::mobility

How the block reacts to a piston pushing it ("movable": default, push, immovable or breaks).

const int QcSignalDefinition::noteCount

Note blocks: number of notes, semitones from the lowest note (F#3, 0) to the highest (F#5, 24).

int QcSignalDefinition::offDelayTicks

Lamps: ticks until it goes dark after losing power (it lights at once).

int QcSignalDefinition::power

Strength a source emits (levers, buttons, plates, torches, repeaters).

int QcSignalDefinition::pulseTicks

Buttons: ticks until it springs back.

bool QcSignalDefinition::quasiConnectivity

Pistons: also powered by what would power the block above them, but only noticed with a block update next to the piston (quasi-connectivity, "BUD"); the world's game rule can switch it off.

int QcSignalDefinition::railReach

Rail slots: how many rails of the same block along the line pass power on.

bool QcSignalDefinition::strongPowersAbove

Torches: strongly power a conductor above them (stone on top passes the power on); the small Signal Torch does not, though it still powers a component above it directly (decision E-745).

bool QcSignalDefinition::usesItems

Dispensers: use items with a dispense action (else every item is thrown, a dropper).

int QcSignalDefinition::wireReach

Hooks: how many cells of tripwire may lie between two hooks of one line.