Esempio n. 1
0
        public static ObjectDef Read(NReader rdr)
        {
            ObjectDef ret = new ObjectDef();

            ret.ObjectType = rdr.ReadInt16();
            ret.Stats      = ObjectStats.Read(rdr);
            return(ret);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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;
        }