// Code generated by protocol buffer compiler. Do not edit!
package emu.nebula.proto;

import java.io.IOException;
import us.hebi.quickbuf.FieldName;
import us.hebi.quickbuf.InvalidProtocolBufferException;
import us.hebi.quickbuf.JsonSink;
import us.hebi.quickbuf.JsonSource;
import us.hebi.quickbuf.MessageFactory;
import us.hebi.quickbuf.ProtoMessage;
import us.hebi.quickbuf.ProtoSink;
import us.hebi.quickbuf.ProtoSource;
import us.hebi.quickbuf.RepeatedByte;
import us.hebi.quickbuf.RepeatedMessage;

public final class VampireSurvivorRewardChest {
  /**
   * Protobuf type {@code VampireSurvivorRewardChestReq}
   */
  public static final class VampireSurvivorRewardChestReq extends ProtoMessage<VampireSurvivorRewardChestReq> implements Cloneable {
    private static final long serialVersionUID = 0L;

    /**
     * <code>optional uint32 EventType = 1;</code>
     */
    private int eventType;

    /**
     * <code>optional uint32 Number = 2;</code>
     */
    private int number;

    /**
     * <code>optional bytes NextPackage = 2047;</code>
     */
    private final RepeatedByte nextPackage = RepeatedByte.newEmptyInstance();

    private VampireSurvivorRewardChestReq() {
    }

    /**
     * @return a new empty instance of {@code VampireSurvivorRewardChestReq}
     */
    public static VampireSurvivorRewardChestReq newInstance() {
      return new VampireSurvivorRewardChestReq();
    }

    /**
     * <code>optional uint32 EventType = 1;</code>
     * @return whether the eventType field is set
     */
    public boolean hasEventType() {
      return (bitField0_ & 0x00000001) != 0;
    }

    /**
     * <code>optional uint32 EventType = 1;</code>
     * @return this
     */
    public VampireSurvivorRewardChestReq clearEventType() {
      bitField0_ &= ~0x00000001;
      eventType = 0;
      return this;
    }

    /**
     * <code>optional uint32 EventType = 1;</code>
     * @return the eventType
     */
    public int getEventType() {
      return eventType;
    }

    /**
     * <code>optional uint32 EventType = 1;</code>
     * @param value the eventType to set
     * @return this
     */
    public VampireSurvivorRewardChestReq setEventType(final int value) {
      bitField0_ |= 0x00000001;
      eventType = value;
      return this;
    }

    /**
     * <code>optional uint32 Number = 2;</code>
     * @return whether the number field is set
     */
    public boolean hasNumber() {
      return (bitField0_ & 0x00000002) != 0;
    }

    /**
     * <code>optional uint32 Number = 2;</code>
     * @return this
     */
    public VampireSurvivorRewardChestReq clearNumber() {
      bitField0_ &= ~0x00000002;
      number = 0;
      return this;
    }

    /**
     * <code>optional uint32 Number = 2;</code>
     * @return the number
     */
    public int getNumber() {
      return number;
    }

    /**
     * <code>optional uint32 Number = 2;</code>
     * @param value the number to set
     * @return this
     */
    public VampireSurvivorRewardChestReq setNumber(final int value) {
      bitField0_ |= 0x00000002;
      number = value;
      return this;
    }

    /**
     * <code>optional bytes NextPackage = 2047;</code>
     * @return whether the nextPackage field is set
     */
    public boolean hasNextPackage() {
      return (bitField0_ & 0x00000004) != 0;
    }

    /**
     * <code>optional bytes NextPackage = 2047;</code>
     * @return this
     */
    public VampireSurvivorRewardChestReq clearNextPackage() {
      bitField0_ &= ~0x00000004;
      nextPackage.clear();
      return this;
    }

    /**
     * <code>optional bytes NextPackage = 2047;</code>
     *
     * This method returns the internal storage object without modifying any has state.
     * The returned object should not be modified and be treated as read-only.
     *
     * Use {@link #getMutableNextPackage()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedByte getNextPackage() {
      return nextPackage;
    }

    /**
     * <code>optional bytes NextPackage = 2047;</code>
     *
     * This method returns the internal storage object and sets the corresponding
     * has state. The returned object will become part of this message and its
     * contents may be modified as long as the has state is not cleared.
     *
     * @return internal storage object for modifications
     */
    public RepeatedByte getMutableNextPackage() {
      bitField0_ |= 0x00000004;
      return nextPackage;
    }

    /**
     * <code>optional bytes NextPackage = 2047;</code>
     * @param value the nextPackage to add
     * @return this
     */
    public VampireSurvivorRewardChestReq addNextPackage(final byte value) {
      bitField0_ |= 0x00000004;
      nextPackage.add(value);
      return this;
    }

    /**
     * <code>optional bytes NextPackage = 2047;</code>
     * @param values the nextPackage to add
     * @return this
     */
    public VampireSurvivorRewardChestReq addAllNextPackage(final byte... values) {
      bitField0_ |= 0x00000004;
      nextPackage.addAll(values);
      return this;
    }

    /**
     * <code>optional bytes NextPackage = 2047;</code>
     * @param values the nextPackage to set
     * @return this
     */
    public VampireSurvivorRewardChestReq setNextPackage(final byte... values) {
      bitField0_ |= 0x00000004;
      nextPackage.copyFrom(values);
      return this;
    }

    @Override
    public VampireSurvivorRewardChestReq copyFrom(final VampireSurvivorRewardChestReq other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        eventType = other.eventType;
        number = other.number;
        nextPackage.copyFrom(other.nextPackage);
      }
      return this;
    }

    @Override
    public VampireSurvivorRewardChestReq mergeFrom(final VampireSurvivorRewardChestReq other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasEventType()) {
        setEventType(other.eventType);
      }
      if (other.hasNumber()) {
        setNumber(other.number);
      }
      if (other.hasNextPackage()) {
        getMutableNextPackage().copyFrom(other.nextPackage);
      }
      return this;
    }

    @Override
    public VampireSurvivorRewardChestReq clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      eventType = 0;
      number = 0;
      nextPackage.clear();
      return this;
    }

    @Override
    public VampireSurvivorRewardChestReq clearQuick() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      nextPackage.clear();
      return this;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof VampireSurvivorRewardChestReq)) {
        return false;
      }
      VampireSurvivorRewardChestReq other = (VampireSurvivorRewardChestReq) o;
      return bitField0_ == other.bitField0_
        && (!hasEventType() || eventType == other.eventType)
        && (!hasNumber() || number == other.number)
        && (!hasNextPackage() || nextPackage.equals(other.nextPackage));
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawByte((byte) 8);
        output.writeUInt32NoTag(eventType);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRawByte((byte) 16);
        output.writeUInt32NoTag(number);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRawLittleEndian16((short) 32762);
        output.writeBytesNoTag(nextPackage);
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(eventType);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(number);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        size += 2 + ProtoSink.computeBytesSizeNoTag(nextPackage);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public VampireSurvivorRewardChestReq mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 8: {
            // eventType
            eventType = input.readUInt32();
            bitField0_ |= 0x00000001;
            tag = input.readTag();
            if (tag != 16) {
              break;
            }
          }
          case 16: {
            // number
            number = input.readUInt32();
            bitField0_ |= 0x00000002;
            tag = input.readTag();
            if (tag != 16378) {
              break;
            }
          }
          case 16378: {
            // nextPackage
            input.readBytes(nextPackage);
            bitField0_ |= 0x00000004;
            tag = input.readTag();
            if (tag != 0) {
              break;
            }
          }
          case 0: {
            return this;
          }
          default: {
            if (!input.skipField(tag)) {
              return this;
            }
            tag = input.readTag();
            break;
          }
        }
      }
    }

    @Override
    public void writeTo(final JsonSink output) throws IOException {
      output.beginObject();
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeUInt32(FieldNames.eventType, eventType);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeUInt32(FieldNames.number, number);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeBytes(FieldNames.nextPackage, nextPackage);
      }
      output.endObject();
    }

    @Override
    public VampireSurvivorRewardChestReq mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case 2035398868: {
            if (input.isAtField(FieldNames.eventType)) {
              if (!input.trySkipNullValue()) {
                eventType = input.readUInt32();
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1950496919: {
            if (input.isAtField(FieldNames.number)) {
              if (!input.trySkipNullValue()) {
                number = input.readUInt32();
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -2082324045: {
            if (input.isAtField(FieldNames.nextPackage)) {
              if (!input.trySkipNullValue()) {
                input.readBytes(nextPackage);
                bitField0_ |= 0x00000004;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

    @Override
    public VampireSurvivorRewardChestReq clone() {
      return new VampireSurvivorRewardChestReq().copyFrom(this);
    }

    @Override
    public boolean isEmpty() {
      return ((bitField0_) == 0);
    }

    public static VampireSurvivorRewardChestReq parseFrom(final byte[] data) throws
        InvalidProtocolBufferException {
      return ProtoMessage.mergeFrom(new VampireSurvivorRewardChestReq(), data).checkInitialized();
    }

    public static VampireSurvivorRewardChestReq parseFrom(final ProtoSource input) throws
        IOException {
      return ProtoMessage.mergeFrom(new VampireSurvivorRewardChestReq(), input).checkInitialized();
    }

    public static VampireSurvivorRewardChestReq parseFrom(final JsonSource input) throws
        IOException {
      return ProtoMessage.mergeFrom(new VampireSurvivorRewardChestReq(), input).checkInitialized();
    }

    /**
     * @return factory for creating VampireSurvivorRewardChestReq messages
     */
    public static MessageFactory<VampireSurvivorRewardChestReq> getFactory() {
      return VampireSurvivorRewardChestReqFactory.INSTANCE;
    }

    private enum VampireSurvivorRewardChestReqFactory implements MessageFactory<VampireSurvivorRewardChestReq> {
      INSTANCE;

      @Override
      public VampireSurvivorRewardChestReq create() {
        return VampireSurvivorRewardChestReq.newInstance();
      }
    }

    /**
     * Contains name constants used for serializing JSON
     */
    static class FieldNames {
      static final FieldName eventType = FieldName.forField("EventType");

      static final FieldName number = FieldName.forField("Number");

      static final FieldName nextPackage = FieldName.forField("NextPackage");
    }
  }

  /**
   * Protobuf type {@code VampireSurvivorRewardChestResp}
   */
  public static final class VampireSurvivorRewardChestResp extends ProtoMessage<VampireSurvivorRewardChestResp> implements Cloneable {
    private static final long serialVersionUID = 0L;

    /**
     * <code>optional bytes NextPackage = 2047;</code>
     */
    private final RepeatedByte nextPackage = RepeatedByte.newEmptyInstance();

    /**
     * <code>repeated .CardInfo ChestCards = 1;</code>
     */
    private final RepeatedMessage<Public.CardInfo> chestCards = RepeatedMessage.newEmptyInstance(Public.CardInfo.getFactory());

    /**
     * <code>repeated .CardInfo ExtraCards = 2;</code>
     */
    private final RepeatedMessage<Public.CardInfo> extraCards = RepeatedMessage.newEmptyInstance(Public.CardInfo.getFactory());

    private VampireSurvivorRewardChestResp() {
    }

    /**
     * @return a new empty instance of {@code VampireSurvivorRewardChestResp}
     */
    public static VampireSurvivorRewardChestResp newInstance() {
      return new VampireSurvivorRewardChestResp();
    }

    /**
     * <code>optional bytes NextPackage = 2047;</code>
     * @return whether the nextPackage field is set
     */
    public boolean hasNextPackage() {
      return (bitField0_ & 0x00000001) != 0;
    }

    /**
     * <code>optional bytes NextPackage = 2047;</code>
     * @return this
     */
    public VampireSurvivorRewardChestResp clearNextPackage() {
      bitField0_ &= ~0x00000001;
      nextPackage.clear();
      return this;
    }

    /**
     * <code>optional bytes NextPackage = 2047;</code>
     *
     * This method returns the internal storage object without modifying any has state.
     * The returned object should not be modified and be treated as read-only.
     *
     * Use {@link #getMutableNextPackage()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedByte getNextPackage() {
      return nextPackage;
    }

    /**
     * <code>optional bytes NextPackage = 2047;</code>
     *
     * This method returns the internal storage object and sets the corresponding
     * has state. The returned object will become part of this message and its
     * contents may be modified as long as the has state is not cleared.
     *
     * @return internal storage object for modifications
     */
    public RepeatedByte getMutableNextPackage() {
      bitField0_ |= 0x00000001;
      return nextPackage;
    }

    /**
     * <code>optional bytes NextPackage = 2047;</code>
     * @param value the nextPackage to add
     * @return this
     */
    public VampireSurvivorRewardChestResp addNextPackage(final byte value) {
      bitField0_ |= 0x00000001;
      nextPackage.add(value);
      return this;
    }

    /**
     * <code>optional bytes NextPackage = 2047;</code>
     * @param values the nextPackage to add
     * @return this
     */
    public VampireSurvivorRewardChestResp addAllNextPackage(final byte... values) {
      bitField0_ |= 0x00000001;
      nextPackage.addAll(values);
      return this;
    }

    /**
     * <code>optional bytes NextPackage = 2047;</code>
     * @param values the nextPackage to set
     * @return this
     */
    public VampireSurvivorRewardChestResp setNextPackage(final byte... values) {
      bitField0_ |= 0x00000001;
      nextPackage.copyFrom(values);
      return this;
    }

    /**
     * <code>repeated .CardInfo ChestCards = 1;</code>
     * @return whether the chestCards field is set
     */
    public boolean hasChestCards() {
      return (bitField0_ & 0x00000002) != 0;
    }

    /**
     * <code>repeated .CardInfo ChestCards = 1;</code>
     * @return this
     */
    public VampireSurvivorRewardChestResp clearChestCards() {
      bitField0_ &= ~0x00000002;
      chestCards.clear();
      return this;
    }

    /**
     * <code>repeated .CardInfo ChestCards = 1;</code>
     *
     * This method returns the internal storage object without modifying any has state.
     * The returned object should not be modified and be treated as read-only.
     *
     * Use {@link #getMutableChestCards()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedMessage<Public.CardInfo> getChestCards() {
      return chestCards;
    }

    /**
     * <code>repeated .CardInfo ChestCards = 1;</code>
     *
     * This method returns the internal storage object and sets the corresponding
     * has state. The returned object will become part of this message and its
     * contents may be modified as long as the has state is not cleared.
     *
     * @return internal storage object for modifications
     */
    public RepeatedMessage<Public.CardInfo> getMutableChestCards() {
      bitField0_ |= 0x00000002;
      return chestCards;
    }

    /**
     * <code>repeated .CardInfo ChestCards = 1;</code>
     * @param value the chestCards to add
     * @return this
     */
    public VampireSurvivorRewardChestResp addChestCards(final Public.CardInfo value) {
      bitField0_ |= 0x00000002;
      chestCards.add(value);
      return this;
    }

    /**
     * <code>repeated .CardInfo ChestCards = 1;</code>
     * @param values the chestCards to add
     * @return this
     */
    public VampireSurvivorRewardChestResp addAllChestCards(final Public.CardInfo... values) {
      bitField0_ |= 0x00000002;
      chestCards.addAll(values);
      return this;
    }

    /**
     * <code>repeated .CardInfo ExtraCards = 2;</code>
     * @return whether the extraCards field is set
     */
    public boolean hasExtraCards() {
      return (bitField0_ & 0x00000004) != 0;
    }

    /**
     * <code>repeated .CardInfo ExtraCards = 2;</code>
     * @return this
     */
    public VampireSurvivorRewardChestResp clearExtraCards() {
      bitField0_ &= ~0x00000004;
      extraCards.clear();
      return this;
    }

    /**
     * <code>repeated .CardInfo ExtraCards = 2;</code>
     *
     * This method returns the internal storage object without modifying any has state.
     * The returned object should not be modified and be treated as read-only.
     *
     * Use {@link #getMutableExtraCards()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedMessage<Public.CardInfo> getExtraCards() {
      return extraCards;
    }

    /**
     * <code>repeated .CardInfo ExtraCards = 2;</code>
     *
     * This method returns the internal storage object and sets the corresponding
     * has state. The returned object will become part of this message and its
     * contents may be modified as long as the has state is not cleared.
     *
     * @return internal storage object for modifications
     */
    public RepeatedMessage<Public.CardInfo> getMutableExtraCards() {
      bitField0_ |= 0x00000004;
      return extraCards;
    }

    /**
     * <code>repeated .CardInfo ExtraCards = 2;</code>
     * @param value the extraCards to add
     * @return this
     */
    public VampireSurvivorRewardChestResp addExtraCards(final Public.CardInfo value) {
      bitField0_ |= 0x00000004;
      extraCards.add(value);
      return this;
    }

    /**
     * <code>repeated .CardInfo ExtraCards = 2;</code>
     * @param values the extraCards to add
     * @return this
     */
    public VampireSurvivorRewardChestResp addAllExtraCards(final Public.CardInfo... values) {
      bitField0_ |= 0x00000004;
      extraCards.addAll(values);
      return this;
    }

    @Override
    public VampireSurvivorRewardChestResp copyFrom(final VampireSurvivorRewardChestResp other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        nextPackage.copyFrom(other.nextPackage);
        chestCards.copyFrom(other.chestCards);
        extraCards.copyFrom(other.extraCards);
      }
      return this;
    }

    @Override
    public VampireSurvivorRewardChestResp mergeFrom(final VampireSurvivorRewardChestResp other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasNextPackage()) {
        getMutableNextPackage().copyFrom(other.nextPackage);
      }
      if (other.hasChestCards()) {
        getMutableChestCards().addAll(other.chestCards);
      }
      if (other.hasExtraCards()) {
        getMutableExtraCards().addAll(other.extraCards);
      }
      return this;
    }

    @Override
    public VampireSurvivorRewardChestResp clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      nextPackage.clear();
      chestCards.clear();
      extraCards.clear();
      return this;
    }

    @Override
    public VampireSurvivorRewardChestResp clearQuick() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      nextPackage.clear();
      chestCards.clearQuick();
      extraCards.clearQuick();
      return this;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof VampireSurvivorRewardChestResp)) {
        return false;
      }
      VampireSurvivorRewardChestResp other = (VampireSurvivorRewardChestResp) o;
      return bitField0_ == other.bitField0_
        && (!hasNextPackage() || nextPackage.equals(other.nextPackage))
        && (!hasChestCards() || chestCards.equals(other.chestCards))
        && (!hasExtraCards() || extraCards.equals(other.extraCards));
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawLittleEndian16((short) 32762);
        output.writeBytesNoTag(nextPackage);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        for (int i = 0; i < chestCards.length(); i++) {
          output.writeRawByte((byte) 10);
          output.writeMessageNoTag(chestCards.get(i));
        }
      }
      if ((bitField0_ & 0x00000004) != 0) {
        for (int i = 0; i < extraCards.length(); i++) {
          output.writeRawByte((byte) 18);
          output.writeMessageNoTag(extraCards.get(i));
        }
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 2 + ProtoSink.computeBytesSizeNoTag(nextPackage);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += (1 * chestCards.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(chestCards);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        size += (1 * extraCards.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(extraCards);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public VampireSurvivorRewardChestResp mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 16378: {
            // nextPackage
            input.readBytes(nextPackage);
            bitField0_ |= 0x00000001;
            tag = input.readTag();
            if (tag != 10) {
              break;
            }
          }
          case 10: {
            // chestCards
            tag = input.readRepeatedMessage(chestCards, tag);
            bitField0_ |= 0x00000002;
            if (tag != 18) {
              break;
            }
          }
          case 18: {
            // extraCards
            tag = input.readRepeatedMessage(extraCards, tag);
            bitField0_ |= 0x00000004;
            if (tag != 0) {
              break;
            }
          }
          case 0: {
            return this;
          }
          default: {
            if (!input.skipField(tag)) {
              return this;
            }
            tag = input.readTag();
            break;
          }
        }
      }
    }

    @Override
    public void writeTo(final JsonSink output) throws IOException {
      output.beginObject();
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeBytes(FieldNames.nextPackage, nextPackage);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRepeatedMessage(FieldNames.chestCards, chestCards);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRepeatedMessage(FieldNames.extraCards, extraCards);
      }
      output.endObject();
    }

    @Override
    public VampireSurvivorRewardChestResp mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case -2082324045: {
            if (input.isAtField(FieldNames.nextPackage)) {
              if (!input.trySkipNullValue()) {
                input.readBytes(nextPackage);
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1273420542: {
            if (input.isAtField(FieldNames.chestCards)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedMessage(chestCards);
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1580054189: {
            if (input.isAtField(FieldNames.extraCards)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedMessage(extraCards);
                bitField0_ |= 0x00000004;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

    @Override
    public VampireSurvivorRewardChestResp clone() {
      return new VampireSurvivorRewardChestResp().copyFrom(this);
    }

    @Override
    public boolean isEmpty() {
      return ((bitField0_) == 0);
    }

    public static VampireSurvivorRewardChestResp parseFrom(final byte[] data) throws
        InvalidProtocolBufferException {
      return ProtoMessage.mergeFrom(new VampireSurvivorRewardChestResp(), data).checkInitialized();
    }

    public static VampireSurvivorRewardChestResp parseFrom(final ProtoSource input) throws
        IOException {
      return ProtoMessage.mergeFrom(new VampireSurvivorRewardChestResp(), input).checkInitialized();
    }

    public static VampireSurvivorRewardChestResp parseFrom(final JsonSource input) throws
        IOException {
      return ProtoMessage.mergeFrom(new VampireSurvivorRewardChestResp(), input).checkInitialized();
    }

    /**
     * @return factory for creating VampireSurvivorRewardChestResp messages
     */
    public static MessageFactory<VampireSurvivorRewardChestResp> getFactory() {
      return VampireSurvivorRewardChestRespFactory.INSTANCE;
    }

    private enum VampireSurvivorRewardChestRespFactory implements MessageFactory<VampireSurvivorRewardChestResp> {
      INSTANCE;

      @Override
      public VampireSurvivorRewardChestResp create() {
        return VampireSurvivorRewardChestResp.newInstance();
      }
    }

    /**
     * Contains name constants used for serializing JSON
     */
    static class FieldNames {
      static final FieldName nextPackage = FieldName.forField("NextPackage");

      static final FieldName chestCards = FieldName.forField("ChestCards");

      static final FieldName extraCards = FieldName.forField("ExtraCards");
    }
  }
}
