private static bool GetSkills(out Hashtable lst) { lst = new Hashtable(); using (StreamReader sr = new StreamReader(string.Format(@"{0}\Data\Skill.txt", _appStartupPath))) { string strLine = ""; strLine = sr.ReadLine(); // 1st line is column header while (!sr.EndOfStream) { strLine = sr.ReadLine(); // id,name,b,a,e,fileb,filea,filee,desc string[] datas = strLine.Split(new char[] { ',' }, 9); Skill dr = new Skill(); dr._id = System.Convert.ToInt32(datas[0]); dr._name = datas[1]; dr._effects[0] = System.Convert.ToInt32(datas[2]); dr._effects[1] = System.Convert.ToInt32(datas[3]); dr._effects[2] = System.Convert.ToInt32(datas[4]); dr._infoImgFileNames[0] = string.Format(@"{0}\Images\Core\Skills\Info\{1}", _appStartupPath, datas[5]); dr._infoImgFileNames[1] = string.Format(@"{0}\Images\Core\Skills\Info\{1}", _appStartupPath, datas[6]); dr._infoImgFileNames[2] = string.Format(@"{0}\Images\Core\Skills\Info\{1}", _appStartupPath, datas[7]); dr._description = datas[8]; lst.Add(dr._id, dr); } } return true; }
public void CopyAllFrom(Hero hero) { CopyFrom(hero); this._player = new Player(); this._player.CopyFrom(hero._player); foreach (Army army in hero._armyKSlots.Values) { this._armyKSlots.Add(army._slotNo, army); } foreach (Spell spell in hero._spells.Values) { Spell spell2 = new Spell(); spell2.CopyFrom(spell); this._spells.Add(spell2._id, spell2); } foreach (Skill skill in hero._skills.Values) { Skill skill2 = new Skill(); skill2.CopyFrom(skill); this._skills.Add(skill2._id, skill2); } }
public void CopyFrom(Skill skill) { this._id = skill._id; this._name = skill._name; this._description = skill._description; this._level = skill._level; this._effects = skill._effects; this._infoImgFileNames = skill._infoImgFileNames; }