Example #1
0
        public void build(byte[] data)
        {
            ByteBuffer buf = ByteBuffer.wrap(data);

            for (int i = 0; i < this.__flag.Length; i++)
            {
                this.__flag[i] = buf.get();
            }

            if (this.hasSeatList())
            {
                int size = buf.getShort();
                for (int i = 0; i < size; i++)
                {
                    byte[] bytes = new byte[buf.getInt()];
                    buf.get(ref bytes, 0, bytes.Length);
                    this.seatList.Add(JY_SEAT.decode(bytes));
                }
            }

            if (this.hasBaseScore())
            {
                this.baseScore = buf.getInt();
            }
        }
Example #2
0
        public static JY_SEAT decode(byte[] data)
        {
            JY_SEAT proto = newBuilder();

            proto.build(data);
            return(proto);
        }
Example #3
0
 public void addSeatList(JY_SEAT value)
 {
     if (!this.hasSeatList())
     {
         this.__flag[0] = (byte)(this.__flag[0] | 1);
     }
     this.seatList.Add(value);
 }
Example #4
0
        public void build(byte[] data)
        {
            ByteBuffer buf = ByteBuffer.wrap(data);

            for (int i = 0; i < this.__flag.Length; i++)
            {
                this.__flag[i] = buf.get();
            }

            if (this.hasSeat())
            {
                byte[] bytes = new byte[buf.getInt()];
                buf.get(ref bytes, 0, bytes.Length);
                this.seat = JY_SEAT.decode(bytes);
            }

            if (this.hasUnixtime())
            {
                this.unixtime = buf.getLong();
            }
        }
Example #5
0
        public void build(byte[] data)
        {
            ByteBuffer buf = ByteBuffer.wrap(data);

            for (int i = 0; i < this.__flag.Length; i++)
            {
                this.__flag[i] = buf.get();
            }

            if (this.hasSettingId())
            {
                int size = buf.getShort();
                for (int i = 0; i < size; i++)
                {
                    this.settingId.Add(buf.getInt());
                }
            }

            if (this.hasRoomId())
            {
                this.roomId = buf.getInt();
            }

            if (this.hasLoop())
            {
                this.loop = buf.getInt();
            }

            if (this.hasStatus())
            {
                this.status = (ROOM_STATUS)buf.get();
            }

            if (this.hasSeatList())
            {
                int size = buf.getShort();
                for (int i = 0; i < size; i++)
                {
                    byte[] bytes = new byte[buf.getInt()];
                    buf.get(ref bytes, 0, bytes.Length);
                    this.seatList.Add(JY_SEAT.decode(bytes));
                }
            }

            if (this.hasMaxLoop())
            {
                this.maxLoop = buf.getInt();
            }

            if (this.hasBaseScore())
            {
                this.baseScore = buf.getInt();
            }

            if (this.hasIsBomb())
            {
                if (buf.get() == 1)
                {
                    this.isBomb = true;
                }
                else
                {
                    this.isBomb = false;
                }
            }

            if (this.hasUnixtime())
            {
                this.unixtime = buf.getLong();
            }
        }