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(Spell spell) { this._id = spell._id; this._name = spell._name; this._elementType = spell._elementType; this._spellType = spell._spellType; this._level = spell._level; this._basicCost = spell._basicCost; this._cost = spell._cost; this._duration = spell._duration; this._basicDamage = spell._basicDamage; this._damageLevels[0] = spell._damageLevels[0]; this._damageLevels[1] = spell._damageLevels[1]; this._damageLevels[2] = spell._damageLevels[2]; this._damage = spell._damage; this._isAll = spell._isAll; this._isSummon = spell._isSummon; this._description = spell._description; this._isMissile = spell._isMissile; this._isHit = spell._isHit; this._targetType = spell._targetType; this._isDamage = spell._isDamage; this._bookImgFileName = spell._bookImgFileName; }
private static bool GetSpells(out Hashtable lst) { lst = new Hashtable(); using (StreamReader sr = new StreamReader(string.Format(@"{0}\Data\Spell.txt", _appStartupPath))) { string strLine = ""; strLine = sr.ReadLine(); // 1st line is column header while (!sr.EndOfStream) { strLine = sr.ReadLine(); // id,name,eleType,level,SpellType,cost,duration,baseDamage,Dmg1,Dmg2,Dmg3,all,summon,isMissile,target,isDamage,bookImgFileName,desc string[] datas = strLine.Split(new char[] { ',' }, 19); Spell dr = new Spell(); dr._id = System.Convert.ToInt32(datas[0]); dr._name = datas[1]; dr._elementType = (ElementTypeEnum)System.Convert.ToInt32(datas[2]); dr._level = System.Convert.ToInt32(datas[3]); dr._spellType = (SpellTypeEnum)System.Convert.ToInt32(datas[4]); dr._basicCost = System.Convert.ToInt32(datas[5]); dr._cost = dr._basicCost; dr._duration = System.Convert.ToInt32(datas[6]); dr._basicDamage = System.Convert.ToInt32(datas[7]); dr._damageLevels[0] = System.Convert.ToInt32(datas[8]); dr._damageLevels[1] = System.Convert.ToInt32(datas[9]); dr._damageLevels[2] = System.Convert.ToInt32(datas[10]); dr._isAll = System.Convert.ToBoolean(System.Convert.ToInt32(datas[11])); dr._isSummon = System.Convert.ToBoolean(System.Convert.ToInt32(datas[12])); dr._isMissile = System.Convert.ToBoolean(System.Convert.ToInt32(datas[13])); dr._isHit = System.Convert.ToBoolean(System.Convert.ToInt32(datas[14])); dr._targetType = (SpellTargetTypeEnum)System.Convert.ToInt32(datas[15]); dr._isDamage = System.Convert.ToBoolean(System.Convert.ToInt32(datas[16])); dr._bookImgFileName = string.Format(@"{0}\Images\Core\Spells\Book\{1}", _appStartupPath, datas[17]); dr._description = datas[18]; lst.Add(dr._id, dr); } } return true; }
public CommandIssuedEventArg(int x, int y, MouseButtons button, bool doubleClick, int cmdType, Spell spell) { _x = x; _y = y; _button = button; _doubleClick = doubleClick; _cmdType = cmdType; _spell = spell; }