C# Class YieldMachine.LampExample.Lamp

Inheritance: StateMachine
Afficher le fichier Open project: eteeselink/YieldMachine Class Usage Examples

Méthodes protégées

Méthode 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 méthode

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
Résultat IEnumerable