Inheritance: StateMachine
Beispiel #1
0
        static void Main(string[] args)
        {
            var sm = new Lamp();
            sm.PressSwitch(); //go on
            sm.PressSwitch(); //go off

            sm.PressSwitch(); //go on
            sm.GotError();    //get error
            sm.PressSwitch(); //go off
        }