public static ObjectDef Read(Client psr, NReader rdr) { ObjectDef ret = new ObjectDef(); ret.ObjectType = (ushort)rdr.ReadInt16(); ret.Stats = ObjectStats.Read(psr, rdr); return(ret); }
public static ObjectDef Read(NReader rdr) { var ret = new ObjectDef(); ret.ObjectType = rdr.ReadUInt16(); ret.Stats = ObjectStats.Read(rdr); return(ret); }
public static ObjectStats Read(Client psr, NReader rdr) { ObjectStats ret = new ObjectStats(); ret.Id = rdr.ReadInt32(); ret.Position = Position.Read(psr, 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 == 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.ReadInt32()); } } return(ret); }
public static ObjectStats Read(NReader rdr) { var 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++) { var type = (StatsType)rdr.ReadByte(); if (type == StatsType.Guild || type == StatsType.Name || (type >= StatsType.InvData0 && type <= StatsType.InvData11)) { ret.Stats[i] = new KeyValuePair <StatsType, object>(type, rdr.ReadUTF()); } else { ret.Stats[i] = new KeyValuePair <StatsType, object>(type, rdr.ReadInt32()); } } return(ret); }
public static ObjectStats Read(NReader rdr) { var ret = new ObjectStats { Id = rdr.ReadInt32(), Position = Position.Read(rdr), 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.ReadInt32()); } } return(ret); }
public static ObjectStats Read(NReader rdr) { ObjectStats 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++) { StatsType 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.ReadInt32()); } return ret; }