Exemplo n.º 1
0
        public static void TestCommand()
        {
            Policia policia = new Policia(null);

            Avisar orden = new Avisar();

            policia.Orden = orden;

            List <IPatrullable> lista = CrearLugares();


            int contador = 1;

            foreach (IPatrullable element in lista)
            {
                policia.patrullarCalles(element);
                if (contador == 5)
                {
                    policia.NumeroOrden = 1;
                }

                if (contador == 10)
                {
                    policia.NumeroOrden = 2;
                }
                contador++;
            }
        }
Exemplo n.º 2
0
        private static ICommand[] generarOrdenes()
        {
            ICommand[] acciones = new  ICommand[3];
            acciones[0] = new Avisar();
            acciones[1] = new DarLaVoz();
            acciones[2] = new Perseguir();

            return(acciones);
        }