protected Player(SerializationInfo info, StreamingContext context) { try { Name = info.GetString("Name"); Sex = (SEX)info.GetValue("Sex", typeof(SEX)); Life = info.GetInt16("Life"); Attack = info.GetInt16("Attack"); Defense = info.GetInt16("Defense"); Hit = info.GetInt16("Hit"); Dodge = info.GetInt16("Dodge"); Essence = info.GetInt16("Essence"); Experience = info.GetInt16("Experience"); MoveSpeed = info.GetInt16("Speed"); Physical_Capacity = info.GetInt16("Physical_Capacity"); Magic_capacity = info.GetInt16("Magical_Capacity"); Life_Resume = info.GetInt16("Life_Resume"); Essence_Resume = info.GetInt16("Essence_Resume"); Physical_Resume = info.GetInt16("Physical_Resume"); Magic_Resume = info.GetInt16("Magical_Resume"); head = new HeadEquipment(); handguard = new HandguardEquipment(); cloth = new ClothEquipment(); shoe = new ShoeEquipment(); weapon = new WeaponEquipment(); items = new List <Item>(); SetItems((List <Item>)info.GetValue("Items", typeof(List <Item>))); SetSkills((List <Skill>)info.GetValue("Skills", typeof(List <Skill>))); SetMyDragons((List <Dragon>)info.GetValue("Dragons", typeof(List <Dragon>))); SetHead((HeadEquipment)info.GetValue("HeadEquipment", typeof(HeadEquipment))); SetHandguard((HandguardEquipment)info.GetValue("HandguardEquipment", typeof(HandguardEquipment))); SetCloth((ClothEquipment)info.GetValue("ClothEquipment", typeof(ClothEquipment))); SetShoe((ShoeEquipment)info.GetValue("ShoeEquipment", typeof(ShoeEquipment))); SetWeapon((WeaponEquipment)info.GetValue("WeaponEquipment", typeof(WeaponEquipment))); } catch (SerializationException) { Console.WriteLine("Serialization Exception!"); } }
public Player(string _name, SEX _sex, int _level, int _speed, int _attack, int _defense, int _life, int _physical_capacity, int _magic_capacity, int _essence, int _hit, int _dodge, int _experience, int _life_resume, int _magic_resume, int _physic_resume, int _essence_resume) : base(_name, _sex, _level, _speed, _attack, _defense, _life, _physical_capacity, _magic_capacity, _essence, _hit, _dodge) { head = new HeadEquipment(); handguard = new HandguardEquipment(); cloth = new ClothEquipment(); shoe = new ShoeEquipment(); weapon = new WeaponEquipment(); items = new List <Item>(); Experience = _experience; Life_Resume = _life_resume; Magic_Resume = _magic_resume; physical_resume = _physic_resume; Essence_Resume = _essence_resume; }
public void SetShoe(ShoeEquipment tmp) { tmp.SetUser(this); shoe = tmp; }