public static FIRST_POKER_INFO decode(byte[] data) { FIRST_POKER_INFO proto = newBuilder(); proto.build(data); return(proto); }
public void addFirstPokerInfo(FIRST_POKER_INFO value) { if (!this.hasFirstPokerInfo()) { this.__flag[0] = (byte)(this.__flag[0] | 128); } this.firstPokerInfo.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.hasPlayerId()) { this.playerId = buf.getInt(); } 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.hasGold()) { this.gold = buf.getInt(); } if (this.hasLongitude()) { this.longitude = buf.getFloat(); } if (this.hasLatitude()) { this.latitude = buf.getFloat(); } if (this.hasIpaddr()) { byte[] bytes = new byte[buf.getShort()]; buf.get(ref bytes, 0, bytes.Length); this.ipaddr = System.Text.Encoding.UTF8.GetString(bytes); } if (this.hasFirstPokerInfo()) { 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.firstPokerInfo.Add(FIRST_POKER_INFO.decode(bytes)); } } if (this.hasSecondPokerInfo()) { 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.secondPokerInfo.Add(SECOND_POKER_INFO.decode(bytes)); } } if (this.hasThirdPokerInfo()) { 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.thirdPokerInfo.Add(THIRD_POKER_INFO.decode(bytes)); } } if (this.hasIsDismiss()) { if (buf.get() == 1) { this.isDismiss = true; } else { this.isDismiss = false; } } if (this.hasGender()) { this.gender = buf.get(); } if (this.hasPos()) { this.pos = buf.getInt(); } if (this.hasSeatStatus()) { this.seatStatus = (SEAT_STATUS)buf.get(); } }