public bool Equals(TalentsBase talents) { if (talents == null || Spec == null) { return(false); } return(talents.ToString().Equals(Spec) && Class == talents.GetClass()); }
public SavedTalentSpec(String name, TalentsBase talentSpec, int tree1, int tree2, int tree3) { Name = name; Tree1 = tree1; Tree2 = tree2; Tree3 = tree3; if (talentSpec != null) { Spec = talentSpec.ToString(); Class = talentSpec.GetClass(); } }
private void OKButton_Click(object sender, RoutedEventArgs e) { if (UpdateCombo.SelectedIndex >= 0) { SavedTalentSpec spec = UpdateCombo.SelectedItem as SavedTalentSpec; spec.Spec = Talents.ToString(); spec.Tree1 = Tree1; spec.Tree2 = Tree2; spec.Tree3 = Tree3; } else { SavedTalentSpec.AllSpecs.Add(new SavedTalentSpec(NewText.Text, Talents, Tree1, Tree2, Tree3)); } this.DialogResult = true; }
private void talentSpecButton_Click(object sender, EventArgs e) { if (((SavedTalentSpec)comboBoxTalentSpec.SelectedItem).Spec == null) { List <SavedTalentSpec> classTalents = new List <SavedTalentSpec>(); foreach (SavedTalentSpec spec in _savedTalents) { if (spec.Class == _character.Class) { classTalents.Add(spec); } } FormSaveTalentSpec form = new FormSaveTalentSpec(classTalents); if (form.ShowDialog(this) == DialogResult.OK) { SavedTalentSpec spec = form.TalentSpec(); String specName = form.TalentSpecName(); if (spec == null) { spec = new SavedTalentSpec(specName, _talents, _tree1Count, _tree2Count, _tree3Count); _savedTalents.Add(spec); } else { spec.Spec = _talents.ToString(); } UpdateSavedTalents(); SaveTalentSpecs(); _character.OnCalculationsInvalidated(); } form.Dispose(); } else { _savedTalents.Remove((SavedTalentSpec)comboBoxTalentSpec.SelectedItem); UpdateSavedTalents(); SaveTalentSpecs(); _character.OnCalculationsInvalidated(); } }