Пример #1
0
        public static SEAT decode(byte[] data)
        {
            SEAT proto = newBuilder();

            proto.build(data);
            return(proto);
        }
Пример #2
0
 public void addSeat(SEAT value)
 {
     if (!this.hasSeat())
     {
         this.__flag[0] = (byte)(this.__flag[0] | 16);
     }
     this.seat.Add(value);
 }
Пример #3
0
 public void addZjhSeat(SEAT value)
 {
     if (!this.hasZjhSeat())
     {
         this.__flag[0] = (byte)(this.__flag[0] | 1);
     }
     this.zjh_seat.Add(value);
 }
        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.hasZjhSeat())
            {
                byte[] bytes = new byte[buf.getInt()];
                buf.get(ref bytes, 0, bytes.Length);
                this.zjh_seat = SEAT.decode(bytes);
            }
        }
Пример #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.hasRoomId())
            {
                this.roomId = buf.getInt();
            }

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

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

            if (this.hasScores())
            {
                this.scores = buf.getInt();
            }

            if (this.hasSeat())
            {
                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.seat.Add(SEAT.decode(bytes));
                }
            }

            if (this.hasRoomstatus())
            {
                this.roomstatus = (ENUM_ROOM_STATUS)buf.get();
            }

            if (this.hasRound())
            {
                this.round = buf.getInt();
            }

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

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

            if (this.hasRoomPour())
            {
                this.RoomPour = buf.getFloat();
            }

            if (this.hasSeatBill())
            {
                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.seat_bill.Add(SEAT_BILL.decode(bytes));
                }
            }

            if (this.hasTotalRound())
            {
                this.totalRound = buf.getInt();
            }

            if (this.hasPlayer())
            {
                byte[] bytes = new byte[buf.getInt()];
                buf.get(ref bytes, 0, bytes.Length);
                this.player = PLAYER.decode(bytes);
            }

            if (this.hasClubId())
            {
                this.clubId = buf.getInt();
            }
        }