/// <summary> /// Saves out newly created race or class and closes the form /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Save_Return_Click(object sender, EventArgs e) { newClass = new JobsAndRaces(Name.Text, (int)intMod.Value, (int)strMod.Value, (int)dexMod.Value, (int)conMod.Value, (int)wisMod.Value, (int)chaMod.Value); if (CreateClass.Checked) { _SaveLoad.Serialize("/Classes/" + newClass.Name, newClass); if (!Exists()) { parent.Classes.Add(newClass); parent.AddItems("Classes", newClass.Name); } this.Close(); } if (CreateRace.Checked) { _SaveLoad.Serialize("/Races/" + newClass.Name, newClass); if (!Exists()) { parent.Races.Add(newClass); parent.AddItems("Races", newClass.Name); } this.Close(); } }
/// <summary> /// Saves our newly created Class or Race /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SaveInfo_Click(object sender, EventArgs e) { if (CreateClass.Checked == true) { newClass = new JobsAndRaces(Name.Text, (int)intMod.Value, (int)strMod.Value, (int)dexMod.Value, (int)conMod.Value, (int)wisMod.Value, (int)chaMod.Value); string file = "/Classes/" + newClass.Name; _SaveLoad.Serialize(file, newClass); if (!Exists()) { parent.Classes.Add(newClass); parent.AddItems("Classes", newClass.Name); } } if (CreateRace.Checked == true) { newClass = new JobsAndRaces(Name.Text, (int)intMod.Value, (int)strMod.Value, (int)dexMod.Value, (int)conMod.Value, (int)wisMod.Value, (int)chaMod.Value); string file = "/Races/" + newClass.Name; _SaveLoad.Serialize(file, newClass); if (!Exists()) { parent.Races.Add(newClass); parent.AddItems("Races", newClass.Name); } } }