private CharacterTemplate ReadClass1() { CharacterTemplate result = CharacterTemplate.CreateEmpty(reader.ReadString()); result.Name = reader.ReadString(); result.Description = reader.ReadString(); result.HPperVIT = reader.ReadInt32(); result.MPperINT = reader.ReadInt32(); result.HPperLVL = reader.ReadInt32(); result.MPperLVL = reader.ReadInt32(); CharacterTemplate.Attrubutes setstat; switch (reader.ReadInt32()) { case 0: { setstat = CharacterTemplate.Attrubutes.STR; break; } case 1: { setstat = CharacterTemplate.Attrubutes.DEX; break; } case 2: default: { setstat = CharacterTemplate.Attrubutes.INT; break; } } result.DamageStat = setstat; result.ArmourPreference = (CharacterTemplate.ArmourTypes)reader.ReadInt32(); result.WeaponPreferenceIDs = ReadListOfString(); result.BaseStats = ReadDictionary(); int skillcount = reader.ReadInt32(); for (int i = 0; i < skillcount; i++) { result.SkillTree.Entries.Add(ReadSkillTreeEntry()); } List <string> invnentoryIDs = new List <string>(); int inventorycount = reader.ReadInt32(); for (int i = 0; i < inventorycount; i++) { invnentoryIDs.Add(reader.ReadString()); } return(result); }
private void createClassToolStripMenuItem_Click(object sender, EventArgs e) { TextPrompt prompt = new TextPrompt(); if (prompt.ShowDialog() == DialogResult.OK) { CharacterTemplate a = CharacterTemplate.CreateEmpty(prompt.Input); List <GameObject.Interfaces.IGameID> abs = classes.ConvertAll(b => (GameObject.Interfaces.IGameID)b); //this will modify the Name if autoname is needed AddWithAutoname(a, abs, true); classes.Add(a); classlist.Items.Add(a); classlist.SelectedItem = a; CurrentClass = a; EditCurrentClass(); } }