C# Class YieldMachine.LampExample.Lamp

Inheritance: StateMachine
Mostrar archivo Open project: eteeselink/YieldMachine Class Usage Examples

Protected Methods

Method Description
WalkStates ( ) : IEnumerable

A lamp state machine. Typical structure: protected override IEnumerable WalkStates() { [state name]: // State entry actions yield return null; // (wait for a trigger to be called) // State exit actions // Transitions from this state, by checking which trigger has been called if (Trigger == PressSwitch) goto [some other state]; // Throw an exception if the trigger was invalid InvalidState(); [some other state]: ... }

Method Details

WalkStates() protected method

A lamp state machine. Typical structure: protected override IEnumerable WalkStates() { [state name]: // State entry actions yield return null; // (wait for a trigger to be called) // State exit actions // Transitions from this state, by checking which trigger has been called if (Trigger == PressSwitch) goto [some other state]; // Throw an exception if the trigger was invalid InvalidState(); [some other state]: ... }
protected WalkStates ( ) : IEnumerable
return IEnumerable