private void ComboBoxTournamentType_SelectionChanged(object sender, SelectionChangedEventArgs e) { changes = true; if (ComboBoxGameSystem.SelectedValue == null) { return; } AbstractRules r = GetRule(); if (r.IsDoubleElimination) { RadioButtonNoCut.IsEnabled = false; RadioButtonNoCut.IsChecked = true; RadioButtonTop4.IsEnabled = false; RadioButtonTop4.IsChecked = false; RadioButtonTop8.IsEnabled = false; RadioButtonTop8.IsChecked = false; RadioButtonTop16.IsEnabled = false; RadioButtonTop16.IsChecked = false; } else { RadioButtonNoCut.IsEnabled = true; RadioButtonTop4.IsEnabled = true; RadioButtonTop8.IsEnabled = true; RadioButtonTop16.IsEnabled = true; } TextBoxMaxSquad.Text = GetRule().DefaultMaxPoints.ToString(); e.Handled = true; }
private AbstractRules GetRule() { if (ComboBoxGameSystem.SelectedValue == null) { return(AbstractRules.GetRule(XWingRules.GetRuleName())); } return(AbstractRules.GetRule(ComboBoxGameSystem.SelectedValue.ToString())); }
public NewPlayerDialog(AbstractRules rules) { InitializeComponent(); TextBoxNickname.Focus(); changes = false; //Noch steuern, welcher Spieler angelegt werden soll foreach (string s in rules.Factions) { ComboBoxFaction.Items.Add(s); } }
public NewTournamentDialog() { InitializeComponent(); tournamentTypes = new List <string> { "SWISS" }; foreach (string s in tournamentTypes) { ComboBoxTournamentType.Items.Add(s); } foreach (string s in AbstractRules.GetAllRuleNames()) { ComboBoxGameSystem.Items.Add(s); } ComboBoxTournamentType.SelectedIndex = 0; changes = false; }
public void SetTournament(Tournament tournament) { bool t3 = tournament == null ? false : tournament.T3ID != 0; ComboBoxGameSystem.Items.Clear(); foreach (string s in AbstractRules.GetAllRuleNames(t3)) { ComboBoxGameSystem.Items.Add(s); } TextboxName.Text = tournament.Name; if (tournament.Cut == TournamentCut.Top4) { RadioButtonTop4.IsChecked = true; } else if (tournament.Cut == TournamentCut.Top8) { RadioButtonTop8.IsChecked = true; } else if (tournament.Cut == TournamentCut.Top16) { RadioButtonTop16.IsChecked = true; } else { RadioButtonNoCut.IsChecked = true; } radioButtonTPYes.IsChecked = tournament.TeamProtection; radioButtonTPNo.IsChecked = !tournament.TeamProtection; TextBoxMaxSquad.Text = tournament.MaxPoints.ToString(); if (tournament.Rule != null) { ComboBoxGameSystem.SelectedValue = tournament.Rule.GetName(); } ComboBoxGameSystem.IsEnabled = true; }