public void startGame(object sender, EventArgs e) { // MessageBox.Show((cbg1.SelectedItem as ComboBoxItem).Content.ToString() + " " + (cbg2.SelectedItem as ComboBoxItem).Content.ToString()); if ((cbg1.SelectedItem as ComboBoxItem).Content.ToString().Equals("Alfa-Beta") || (cbg2.SelectedItem as ComboBoxItem).Content.ToString().Equals("Alfa-Beta") || (cbg2.SelectedItem as ComboBoxItem).Content.ToString().Equals("Człowiek")) { MessageBox.Show("Zaimplementowane rozgrywki: Człowiek vs MinMax oraz MinMax vs MinMax"); } else { Window parentWindow = Window.GetWindow(this); var okn = new OknoGry((cbg1.SelectedItem as ComboBoxItem).Content.ToString(), (cbg2.SelectedItem as ComboBoxItem).Content.ToString(), (cbalg1.SelectedItem as ComboBoxItem).Content.ToString(), (cbalg2.SelectedItem as ComboBoxItem).Content.ToString(), (cbheur1.SelectedItem as ComboBoxItem).Content.ToString(), (cbheur2.SelectedItem as ComboBoxItem).Content.ToString()); if ((cbg1.SelectedItem as ComboBoxItem).Content.ToString().Equals("Człowiek")) { CompPlayerMM cp = new CompPlayerMM(Convert.ToInt32((cbalg2.SelectedItem as ComboBoxItem).Content.ToString())); // okn.msg((Convert.ToInt32((cbalg2.SelectedItem as ComboBoxItem).Content.ToString())).ToString()); Connect4 c4 = new Connect4(cp, okn); cp.setC4(c4); cp.setSymbol('Y'); okn.Con4 = c4; // okn.msg("start"); } if ((cbg1.SelectedItem as ComboBoxItem).Content.ToString().Equals("MinMax")) { CompPlayerMM cp = new CompPlayerMM(Convert.ToInt32((cbalg1.SelectedItem as ComboBoxItem).Content.ToString())); CompPlayerMM cp2 = new CompPlayerMM(Convert.ToInt32((cbalg2.SelectedItem as ComboBoxItem).Content.ToString())); // okn.msg((Convert.ToInt32((cbalg2.SelectedItem as ComboBoxItem).Content.ToString())).ToString()); Connect4 c4 = new Connect4(cp, cp2, okn); cp.setC4(c4); cp.setSymbol('Y'); cp2.setC4(c4); cp2.setSymbol('R'); okn.Con4 = c4; // okn.msg("start"); } okn.Show(); parentWindow.Close(); } }
public abstract void setC4(Connect4 c4);
public override void setC4(Connect4 c4) { this.c4 = c4; }