Skip to main content

Trigger

An abstract class in Root.Township, the global namespace.

Base of on/off inputs like Lever and TwoStepLever. Fires turned on and turned off events and can act as a toggle. Saves its toggle settings.

Constructors​

MemberWhat it is
protected Trigger()Creates a Trigger with default values.

Fields​

5 private and internal fields
MemberWhat it is
private bool syncWithSenderIn toggle mode, keeps the toggle state in line with this object's LogicBoolSender value. Saved.
private bool toggleWhen true, each turn-on flips between firing turnedOn and turnedOff, like a push button. Saved.
private bool toggleStateCurrent state in toggle mode.
private AltaEvent turnedOffEvent fired when the trigger turns off (or toggles off).
private AltaEvent turnedOnEvent fired when the trigger turns on (or toggles on).

Properties​

MemberWhat it is
bool IsOn { get; protected set; }Current raw state.

Events​

MemberWhat it is
event Action TurnedOffFired when the output turns off.
event Action TurnedOnFired when the output turns on.

Methods​

MemberWhat it is
protected void Set(bool isOn)Sets the state. In toggle mode each switch-on flips the output instead, optionally kept in step with a LogicBoolSender.
1 private and internal method
MemberWhat it is
private bool CheckSenderMatch(bool value)Whether the given value matches the LogicBoolSender on this object.