コード例 #1
0
ファイル: Command.cs プロジェクト: slpngl/Jogos-de-Guerra
 public CommandCriarCavalaria(
     AbstractFactoryExercito factory,
     List <ElementosDoExercito> elementos)
 {
     this.Elementos = elementos;
     this.Factory   = factory;
 }
コード例 #2
0
 public CommandCriarGuerreiro(
     AbstractFactoryExercito factory,
     List <ElementoDoExercito> elementos)
 {
     this.Elementos = elementos;
     this.Factory   = factory;
 }
コード例 #3
0
        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();
        }
コード例 #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();
        }