Ejemplo n.º 1
0
 public CommandCriarCavalaria(
     AbstractFactoryExercito factory,
     List <ElementosDoExercito> elementos)
 {
     this.Elementos = elementos;
     this.Factory   = factory;
 }
Ejemplo n.º 2
0
 public CommandCriarGuerreiro(
     AbstractFactoryExercito factory,
     List <ElementoDoExercito> elementos)
 {
     this.Elementos = elementos;
     this.Factory   = factory;
 }
        private void BtnEscolherExercito_Click(object sender, RoutedEventArgs e)
        {
            AbstractFactoryExercito factory = null;

            if (sender == BtnEgito)
            {
                factory =
                    AbstractFactoryExercito.CriarFactoryExercito(
                        AbstractFactoryExercito.Nacao.Egito);
            }
            else if (sender == BtnPersia)
            {
                factory =
                    AbstractFactoryExercito.CriarFactoryExercito(
                        AbstractFactoryExercito.Nacao.Persia);
            }
            else if (sender == BtnIndia)
            {
                factory =
                    AbstractFactoryExercito.CriarFactoryExercito(
                        AbstractFactoryExercito.Nacao.India);
            }
            else if (sender == BtnFenicia)
            {
                factory =
                    AbstractFactoryExercito.CriarFactoryExercito(
                        AbstractFactoryExercito.Nacao.Fenicia);
            }

            TelaDeGuerra tg = new TelaDeGuerra();

            tg.FactoryExercito = factory;
            tg.ShowDialog();
        }
Ejemplo n.º 4
0
        private void BtnEscolherExercito_Click(object sender, RoutedEventArgs e)
        {
            AbstractFactoryExercito factory = null;

            if (sender == BtnEgito)
            {
                //factory =
            }
            else if (sender == BtnPersia)
            {
                factory = new FactoryExercitoPersa();
            }
            else if (sender == BtnIndia)
            {
                factory = new FactoryExercitoIndiano();
            }


            TelaDeGuerra tg = new TelaDeGuerra();

            tg.FactoryExercito = factory;
            tg.ShowDialog();
        }