public static NN_POKER decode(byte[] data) { NN_POKER proto = newBuilder(); proto.build(data); return(proto); }
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.hasNnPoker()) { 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.nn_poker.Add(NN_POKER.decode(bytes)); } } if (this.hasPos()) { this.pos = buf.getInt(); } }
public void addNnPoker(NN_POKER value) { if (!this.hasNnPoker()) { this.__flag[0] = (byte)(this.__flag[0] | 1); } this.nn_poker.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.hasGender()) { this.gender = buf.get(); } if (this.hasGold()) { this.gold = buf.getInt(); } if (this.hasIsBanker()) { if (buf.get() == 1) { this.isBanker = true; } else { this.isBanker = false; } } if (this.hasIsWiner()) { if (buf.get() == 1) { this.isWiner = true; } else { this.isWiner = false; } } if (this.hasNnEarnings()) { this.nn_earnings = buf.getInt(); } if (this.hasPour()) { this.pour = buf.getInt(); } if (this.hasPos()) { this.pos = buf.getInt(); } if (this.hasNnPoker()) { 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.nn_poker.Add(NN_POKER.decode(bytes)); } } if (this.hasIsHomeowners()) { if (buf.get() == 1) { this.IsHomeowners = true; } else { this.IsHomeowners = false; } } if (this.hasDissolve()) { this.dissolve = (NN_ENUM_SEAT_DISSOLVE)buf.get(); } if (this.hasNnPokerType()) { this.nn_pokerType = buf.getInt(); } if (this.hasReady()) { if (buf.get() == 1) { this.ready = true; } else { this.ready = false; } } if (this.hasRobZhuang()) { this.rob_zhuang = buf.getInt(); } if (this.hasOnline()) { this.online = buf.getLong(); } if (this.hasLongitude()) { this.longitude = buf.getFloat(); } if (this.hasLatitude()) { this.latitude = buf.getFloat(); } }