Ejemplo n.º 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();
        }
Ejemplo n.º 2
0
 public override void TurnContex(LightContext context)
 {
     context.CurrentLight = new GreenLight();
 }
Ejemplo n.º 3
0
 public abstract void TurnContex(LightContext context);