static void Main(string[] args) { FlashLight _myFlashlight = new FlashLight(); var mode = 'x'; while (char.ToUpper(mode) != 'Q') { Console.WriteLine("Enter event: "); mode = Console.ReadKey().KeyChar; switch (char.ToUpper(mode)) { case 'X': _myFlashlight.X(); break; case 'Y': _myFlashlight.Y(); break; } } }
public override void HandleMode(FlashLight fl) { fl.Flashing(); fl.SetState(new Solid()); }
public virtual void OnEnter(FlashLight fl) { }
public override void OnEnter(FlashLight fl) { }
public override void HandlePower(FlashLight fl) { fl.LightOn(); fl.SetState(new On()); }
public override void OnEnter(FlashLight fl) { fl.SetState(new Solid()); }
public virtual void HandleMode(FlashLight fl) { }
public virtual void HandlePower(FlashLight fl) { }