Пример #1
0
 public override void Init(IDataReader reader, List <string> fields)
 {
     if (fields.Contains(nameof(CreatureId)))
     {
         this.CreatureId = new Guid(reader[nameof(this.CreatureId)].ToString());
     }
     if (fields.Contains(nameof(CreatureType)))
     {
         this.CreatureType = (ECreatureType)Enum.Parse(typeof(ECreatureType), reader[nameof(this.CreatureType)].ToString());
     }
     if (fields.Contains(nameof(Name)))
     {
         this.Name = Convert.ToString(reader[nameof(this.Name)]);
     }
     if (fields.Contains(nameof(Experience)))
     {
         this.Experience = Convert.ToInt32(reader[nameof(this.Experience)]);
     }
     if (fields.Contains(nameof(Level)))
     {
         this.Level = Convert.ToInt16(reader[nameof(this.Level)]);
     }
     if (fields.Contains(nameof(Profession)))
     {
         this.Profession = (EProfession)Enum.Parse(typeof(EProfession), reader[nameof(this.Profession)].ToString());
     }
 }
Пример #2
0
 public override void Init(IDataReader reader)
 {
     this.CreatureId   = new Guid(reader[nameof(this.CreatureId)].ToString());
     this.CreatureType = (ECreatureType)Enum.Parse(typeof(ECreatureType), reader[nameof(this.CreatureType)].ToString());
     this.Name         = Convert.ToString(reader[nameof(this.Name)]);
     this.Experience   = Convert.ToInt32(reader[nameof(this.Experience)]);
     this.Level        = Convert.ToInt16(reader[nameof(this.Level)]);
     this.Profession   = (EProfession)Enum.Parse(typeof(EProfession), reader[nameof(this.Profession)].ToString());
 }
Пример #3
0
 public void SetProfession(EProfession profession)
 {
     _data2 = (byte)(_data2 & ~MASK_PROFESSION + ((byte)profession) << 4);
 }