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

            proto.build(data);
            return(proto);
        }
Пример #2
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())
            {
                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(DDZ_SEAT.decode(bytes));
                }
            }

            if (this.hasRemainPokerNum())
            {
                this.remainPokerNum = buf.getInt();
            }

            if (this.hasLoop())
            {
                this.loop = buf.getInt();
            }
        }
Пример #3
0
 public void addSeatList(DDZ_SEAT value)
 {
     if (!this.hasSeatList())
     {
         this.__flag[1] = (byte)(this.__flag[1] | 1);
     }
     this.seatList.Add(value);
 }
Пример #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 = DDZ_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.hasLoop())
            {
                this.loop = buf.getInt();
            }

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

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

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

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

            if (this.hasTimes())
            {
                this.times = buf.getInt();
            }

            if (this.hasDizhu())
            {
                this.dizhu = buf.getInt();
            }

            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(DDZ_SEAT.decode(bytes));
                }
            }

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

            if (this.hasCurrentPlayPokerPos())
            {
                this.currentPlayPokerPos = buf.getInt();
            }

            if (this.hasBasePokerList())
            {
                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.basePokerList.Add(DDZ_POCKER.decode(bytes));
                }
            }

            if (this.hasOwnerId())
            {
                this.ownerId = buf.getInt();
            }

            if (this.hasCurrentQiangPlayerId())
            {
                this.currentQiangPlayerId = buf.getInt();
            }

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