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.hasPour()) { this.pour = buf.getInt(); } if (this.hasPoker()) { byte[] bytes = new byte[buf.getInt()]; buf.get(ref bytes, 0, bytes.Length); this.poker = JY_POKER.decode(bytes); } if (this.hasPos()) { this.pos = buf.getInt(); } }
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.hasPos()) { this.pos = buf.getInt(); } if (this.hasPlayerId()) { this.playerId = buf.getInt(); } if (this.hasGold()) { this.gold = buf.getInt(); } if (this.hasPour()) { this.pour = buf.getInt(); } if (this.hasIsBanker()) { if (buf.get() == 1) { this.isBanker = true; } else { this.isBanker = false; } } if (this.hasIsDismiss()) { if (buf.get() == 1) { this.isDismiss = true; } else { this.isDismiss = false; } } if (this.hasPokerList()) { 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.pokerList.Add(JY_POKER.decode(bytes)); } } if (this.hasStatus()) { this.status = (SEAT_STATUS)buf.get(); } if (this.hasNickname()) { byte[] bytes = new byte[buf.getShort()]; buf.get(ref bytes, 0, bytes.Length); this.nickname = System.Text.Encoding.UTF8.GetString(bytes); } if (this.hasAvatar()) { byte[] bytes = new byte[buf.getShort()]; buf.get(ref bytes, 0, bytes.Length); this.avatar = System.Text.Encoding.UTF8.GetString(bytes); } if (this.hasGender()) { this.gender = buf.get(); } if (this.hasEarnings()) { this.earnings = buf.getInt(); } if (this.hasHistoryPokerList()) { 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.historyPokerList.Add(JY_POKER.decode(bytes)); } } if (this.hasIsReady()) { if (buf.get() == 1) { this.isReady = true; } else { this.isReady = false; } } if (this.hasIsJoinGame()) { if (buf.get() == 1) { this.isJoinGame = true; } else { this.isJoinGame = false; } } if (this.hasLoopEarnings()) { this.loopEarnings = buf.getInt(); } if (this.hasIsOnLine()) { if (buf.get() == 1) { this.isOnLine = true; } else { this.isOnLine = false; } } }