public CommandCriarCavalaria( AbstractFactoryExercito factory, List <ElementosDoExercito> elementos) { this.Elementos = elementos; this.Factory = factory; }
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(); }
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(); }