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