SignalRules class

What each block is to a SignalNetwork, by id. Every state is a block id (a lever on and off, a lit and an unlit lamp), so a flip is a plain setBlock and meshing, saving and networking come free.

Constructors

SignalRules({required int wireOff, required int wireOn, Set<int> sources = const {}, Set<int> pressSources = const {}, Map<int, int> toggles = const {}, Map<int, ButtonRule> buttons = const {}, Map<int, SignalReaction> reactions = const {}, int maxStrength = 15, double period = 0.1, int networkCap = 400})
The rules of one game.
const

Properties

buttons → Map<int, ButtonRule>
What SignalNetwork.use presses, and for how long.
final
hashCode → int
The hash code for this object.
no setterinherited
maxStrength → int
The strength beside a source; a wire carries one less per link.
final
networkCap → int
The most wire cells one rebuild floods.
final
period → double
Seconds between two rebuilds of dirty networks.
final
pressSources → Set<int>
Blocks that power only while pressed (a plate with a body on it): see SignalNetwork.setPressed.
final
reactions → Map<int, SignalReaction>
What reacts to power, by id: lamps, doors, pistons, TNT, powered rails.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sources → Set<int>
Blocks that power what touches them while they stand (a lever on, a button pressed, a powered block).
final
toggles → Map<int, int>
What SignalNetwork.use turns a block into (a lever off to on, and back).
final
wireOff → int
An unpowered wire.
final
wireOn → int
A powered wire.
final

Methods

isCircuit(int id) → bool
Whether id takes part in circuits at all.
isWire(int id) → bool
Whether id is a wire.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited