Beispiel #1
0
        static void Main(string[] args)
        {
            BaseLight    light   = new RedLight();
            LightContext context = new LightContext();

            context.CurrentLight = light;
            context.Show();
            context.Turn();
            context.Show();
            context.Turn();
            context.Show();
            context.Turn();
            Console.ReadLine();
        }
 public override void TurnContex(LightContext context)
 {
     context.CurrentLight = new GreenLight();
 }
 public abstract void TurnContex(LightContext context);