public Character(string Name, int[] stats, int[] mod, Race race, Classes classes, Backgrounds backgrounds) { charName = Name; charStats = stats; charStatMod = mod; level = 1; charRace = race; charClass = classes; charBack = backgrounds; foreach (Ability ab in charClass.classAbilities.Ability) { if (level == ab.lvl) { charAbilities.Add(ab); } } foreach (string item in charClass.otherEquipment) { Equipment.Add(item); } foreach (string item in charBack.backEquip) { Equipment.Add(item); } charGold = backgrounds.backGold; string messageBoxText = "Character Saved."; string caption = "Save Successful"; MessageBoxButtons buttons = MessageBoxButtons.OK; MessageBoxIcon icon = MessageBoxIcon.Information; MessageBox.Show(messageBoxText, caption, buttons, icon); }
public Backgrounds selectBack(string selected) { Backgrounds selectedBack = new Backgrounds(); foreach (Backgrounds b in avaliableBackgrounds) { if (selected == b.backName) { selectedBack = b; break; } } return(selectedBack); }
private void cboBackground_SelectedIndexChanged(object sender, EventArgs e) { string Selected = cboBackground.SelectedItem.ToString(); backgrounds = aBacks.selectBack(Selected); string descriptionTxt = string.Format("Name: {0}\nDescription: {1}", backgrounds.backName, backgrounds.description); descriptionTxt = descriptionTxt + "\n------------------------------"; descriptionTxt = descriptionTxt + "\nSkill Proficiencies: "; foreach (string skill in backgrounds.skillProfs) { descriptionTxt = descriptionTxt + "\n" + skill; } descriptionTxt = descriptionTxt + "\n------------------------------"; descriptionTxt = descriptionTxt + "\nTool Proficiencies: "; if (backgrounds.toolProfs.Count() == 0) { descriptionTxt = descriptionTxt + "\nNone"; } else { foreach (string tool in backgrounds.toolProfs) { descriptionTxt = descriptionTxt + "\n" + tool; } } descriptionTxt = descriptionTxt + "\n------------------------------"; descriptionTxt = descriptionTxt + "\nNumber of New Lanauges: " + Convert.ToString(backgrounds.languageChoices); descriptionTxt = descriptionTxt + "\n------------------------------"; descriptionTxt = descriptionTxt + "\nBackground Equipment: "; if (backgrounds.backEquip.Count() == 0) { descriptionTxt = descriptionTxt + "\nNone"; } else { foreach (string equip in backgrounds.backEquip) { descriptionTxt = descriptionTxt + "\n" + equip; } } descriptionTxt = descriptionTxt + "\n------------------------------"; descriptionTxt = descriptionTxt + "\nGold from Background: " + Convert.ToString(backgrounds.backGold) + "GP"; descriptionTxt = descriptionTxt + "\n------------------------------"; descriptionTxt = descriptionTxt + "\nFeature: "; descriptionTxt = descriptionTxt + backgrounds.feature; rtxtDescription.Text = descriptionTxt; }