void update_selected_theme(MonsterTheme theme, bool reset_powers) { if (theme != null) { ThemeNameLbl.Text = theme.Name; fCard.ThemeID = theme.ID; } else { ThemeNameLbl.Text = "None"; fCard.ThemeID = Guid.Empty; } AttackBox.Items.Clear(); AttackBox.Items.Add("(no attack power)"); UtilityBox.Items.Clear(); UtilityBox.Items.Add("(no utility power)"); if (theme != null) { List <ThemePowerData> attacks = theme.ListPowers(fCard.Roles, PowerType.Attack); foreach (ThemePowerData tpd in attacks) { AttackBox.Items.Add(tpd); } List <ThemePowerData> utilities = theme.ListPowers(fCard.Roles, PowerType.Utility); foreach (ThemePowerData tpd in utilities) { UtilityBox.Items.Add(tpd); } } if (reset_powers) { AttackBox.SelectedIndex = 0; UtilityBox.SelectedIndex = 0; } AttackBox.Enabled = (AttackBox.Items.Count > 1); UtilityBox.Enabled = (UtilityBox.Items.Count > 1); update_browser(); }
private void update_selected_theme(MonsterTheme theme, bool reset_powers) { if (theme == null) { this.ThemeNameLbl.Text = "None"; this.fCard.ThemeID = Guid.Empty; } else { this.ThemeNameLbl.Text = theme.Name; this.fCard.ThemeID = theme.ID; } this.AttackBox.Items.Clear(); this.AttackBox.Items.Add("(no attack power)"); this.UtilityBox.Items.Clear(); this.UtilityBox.Items.Add("(no utility power)"); if (theme != null) { foreach (ThemePowerData themePowerDatum in theme.ListPowers(this.fCard.Roles, PowerType.Attack)) { this.AttackBox.Items.Add(themePowerDatum); } foreach (ThemePowerData themePowerDatum1 in theme.ListPowers(this.fCard.Roles, PowerType.Utility)) { this.UtilityBox.Items.Add(themePowerDatum1); } } if (reset_powers) { this.AttackBox.SelectedIndex = 0; this.UtilityBox.SelectedIndex = 0; } this.AttackBox.Enabled = this.AttackBox.Items.Count > 1; this.UtilityBox.Enabled = this.UtilityBox.Items.Count > 1; this.update_browser(); }