public static ObjectDef Read(DReader rdr) { ObjectDef ret = new ObjectDef(); ret.ObjectType = (ushort)rdr.ReadInt16(); ret.Stats = ObjectStats.Read(rdr); return(ret); }
public static ObjectStats Read(DReader rdr) { ObjectStats ret = new ObjectStats(); ret.Id = rdr.ReadInt32(); ret.Position = Position.Read(rdr); ret.Stats = new KeyValuePair <StatsType, object> [rdr.ReadInt16()]; for (int i = 0; i < ret.Stats.Length; i++) { StatsType type = (StatsType)rdr.ReadByte(); if (type.IsUTF()) { ret.Stats[i] = new KeyValuePair <StatsType, object>(type, rdr.ReadUTF()); } else { ret.Stats[i] = new KeyValuePair <StatsType, object>(type, rdr.ReadInt32()); } } return(ret); }