// 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 StarTowerInteract {
  /**
   * Protobuf type {@code StarTowerInteractReq}
   */
  public static final class StarTowerInteractReq extends ProtoMessage<StarTowerInteractReq> implements Cloneable {
    private static final long serialVersionUID = 0L;

    /**
     * <code>optional uint32 Id = 1;</code>
     */
    private int id;

    /**
     * <code>optional .InteractEnterReq EnterReq = 2;</code>
     */
    private final PublicStarTower.InteractEnterReq enterReq = PublicStarTower.InteractEnterReq.newInstance();

    /**
     * <code>optional .InteractBattleEndReq BattleEndReq = 3;</code>
     */
    private final PublicStarTower.InteractBattleEndReq battleEndReq = PublicStarTower.InteractBattleEndReq.newInstance();

    /**
     * <code>optional .InteractSelectReq SelectReq = 4;</code>
     */
    private final PublicStarTower.InteractSelectReq selectReq = PublicStarTower.InteractSelectReq.newInstance();

    /**
     * <code>optional .InteractRecoveryHPReq RecoveryHPReq = 5;</code>
     */
    private final PublicStarTower.InteractRecoveryHPReq recoveryHPReq = PublicStarTower.InteractRecoveryHPReq.newInstance();

    /**
     * <code>optional .InteractHawkerReq HawkerReq = 6;</code>
     */
    private final PublicStarTower.InteractHawkerReq hawkerReq = PublicStarTower.InteractHawkerReq.newInstance();

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

    private StarTowerInteractReq() {
    }

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

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

    /**
     * <code>optional uint32 Id = 1;</code>
     * @return this
     */
    public StarTowerInteractReq clearId() {
      bitField0_ &= ~0x00000001;
      id = 0;
      return this;
    }

    /**
     * <code>optional uint32 Id = 1;</code>
     * @return the id
     */
    public int getId() {
      return id;
    }

    /**
     * <code>optional uint32 Id = 1;</code>
     * @param value the id to set
     * @return this
     */
    public StarTowerInteractReq setId(final int value) {
      bitField0_ |= 0x00000001;
      id = value;
      return this;
    }

    /**
     * <code>optional .InteractEnterReq EnterReq = 2;</code>
     * @return whether the enterReq field is set
     */
    public boolean hasEnterReq() {
      return (bitField0_ & 0x00000002) != 0;
    }

    /**
     * <code>optional .InteractEnterReq EnterReq = 2;</code>
     * @return this
     */
    public StarTowerInteractReq clearEnterReq() {
      bitField0_ &= ~0x00000002;
      enterReq.clear();
      return this;
    }

    /**
     * <code>optional .InteractEnterReq EnterReq = 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 #getMutableEnterReq()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public PublicStarTower.InteractEnterReq getEnterReq() {
      return enterReq;
    }

    /**
     * <code>optional .InteractEnterReq EnterReq = 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 PublicStarTower.InteractEnterReq getMutableEnterReq() {
      bitField0_ |= 0x00000002;
      return enterReq;
    }

    /**
     * <code>optional .InteractEnterReq EnterReq = 2;</code>
     * @param value the enterReq to set
     * @return this
     */
    public StarTowerInteractReq setEnterReq(final PublicStarTower.InteractEnterReq value) {
      bitField0_ |= 0x00000002;
      enterReq.copyFrom(value);
      return this;
    }

    /**
     * <code>optional .InteractBattleEndReq BattleEndReq = 3;</code>
     * @return whether the battleEndReq field is set
     */
    public boolean hasBattleEndReq() {
      return (bitField0_ & 0x00000004) != 0;
    }

    /**
     * <code>optional .InteractBattleEndReq BattleEndReq = 3;</code>
     * @return this
     */
    public StarTowerInteractReq clearBattleEndReq() {
      bitField0_ &= ~0x00000004;
      battleEndReq.clear();
      return this;
    }

    /**
     * <code>optional .InteractBattleEndReq BattleEndReq = 3;</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 #getMutableBattleEndReq()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public PublicStarTower.InteractBattleEndReq getBattleEndReq() {
      return battleEndReq;
    }

    /**
     * <code>optional .InteractBattleEndReq BattleEndReq = 3;</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 PublicStarTower.InteractBattleEndReq getMutableBattleEndReq() {
      bitField0_ |= 0x00000004;
      return battleEndReq;
    }

    /**
     * <code>optional .InteractBattleEndReq BattleEndReq = 3;</code>
     * @param value the battleEndReq to set
     * @return this
     */
    public StarTowerInteractReq setBattleEndReq(final PublicStarTower.InteractBattleEndReq value) {
      bitField0_ |= 0x00000004;
      battleEndReq.copyFrom(value);
      return this;
    }

    /**
     * <code>optional .InteractSelectReq SelectReq = 4;</code>
     * @return whether the selectReq field is set
     */
    public boolean hasSelectReq() {
      return (bitField0_ & 0x00000008) != 0;
    }

    /**
     * <code>optional .InteractSelectReq SelectReq = 4;</code>
     * @return this
     */
    public StarTowerInteractReq clearSelectReq() {
      bitField0_ &= ~0x00000008;
      selectReq.clear();
      return this;
    }

    /**
     * <code>optional .InteractSelectReq SelectReq = 4;</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 #getMutableSelectReq()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public PublicStarTower.InteractSelectReq getSelectReq() {
      return selectReq;
    }

    /**
     * <code>optional .InteractSelectReq SelectReq = 4;</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 PublicStarTower.InteractSelectReq getMutableSelectReq() {
      bitField0_ |= 0x00000008;
      return selectReq;
    }

    /**
     * <code>optional .InteractSelectReq SelectReq = 4;</code>
     * @param value the selectReq to set
     * @return this
     */
    public StarTowerInteractReq setSelectReq(final PublicStarTower.InteractSelectReq value) {
      bitField0_ |= 0x00000008;
      selectReq.copyFrom(value);
      return this;
    }

    /**
     * <code>optional .InteractRecoveryHPReq RecoveryHPReq = 5;</code>
     * @return whether the recoveryHPReq field is set
     */
    public boolean hasRecoveryHPReq() {
      return (bitField0_ & 0x00000010) != 0;
    }

    /**
     * <code>optional .InteractRecoveryHPReq RecoveryHPReq = 5;</code>
     * @return this
     */
    public StarTowerInteractReq clearRecoveryHPReq() {
      bitField0_ &= ~0x00000010;
      recoveryHPReq.clear();
      return this;
    }

    /**
     * <code>optional .InteractRecoveryHPReq RecoveryHPReq = 5;</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 #getMutableRecoveryHPReq()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public PublicStarTower.InteractRecoveryHPReq getRecoveryHPReq() {
      return recoveryHPReq;
    }

    /**
     * <code>optional .InteractRecoveryHPReq RecoveryHPReq = 5;</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 PublicStarTower.InteractRecoveryHPReq getMutableRecoveryHPReq() {
      bitField0_ |= 0x00000010;
      return recoveryHPReq;
    }

    /**
     * <code>optional .InteractRecoveryHPReq RecoveryHPReq = 5;</code>
     * @param value the recoveryHPReq to set
     * @return this
     */
    public StarTowerInteractReq setRecoveryHPReq(
        final PublicStarTower.InteractRecoveryHPReq value) {
      bitField0_ |= 0x00000010;
      recoveryHPReq.copyFrom(value);
      return this;
    }

    /**
     * <code>optional .InteractHawkerReq HawkerReq = 6;</code>
     * @return whether the hawkerReq field is set
     */
    public boolean hasHawkerReq() {
      return (bitField0_ & 0x00000020) != 0;
    }

    /**
     * <code>optional .InteractHawkerReq HawkerReq = 6;</code>
     * @return this
     */
    public StarTowerInteractReq clearHawkerReq() {
      bitField0_ &= ~0x00000020;
      hawkerReq.clear();
      return this;
    }

    /**
     * <code>optional .InteractHawkerReq HawkerReq = 6;</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 #getMutableHawkerReq()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public PublicStarTower.InteractHawkerReq getHawkerReq() {
      return hawkerReq;
    }

    /**
     * <code>optional .InteractHawkerReq HawkerReq = 6;</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 PublicStarTower.InteractHawkerReq getMutableHawkerReq() {
      bitField0_ |= 0x00000020;
      return hawkerReq;
    }

    /**
     * <code>optional .InteractHawkerReq HawkerReq = 6;</code>
     * @param value the hawkerReq to set
     * @return this
     */
    public StarTowerInteractReq setHawkerReq(final PublicStarTower.InteractHawkerReq value) {
      bitField0_ |= 0x00000020;
      hawkerReq.copyFrom(value);
      return this;
    }

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

    /**
     * <code>optional bytes NextPackage = 2047;</code>
     * @return this
     */
    public StarTowerInteractReq clearNextPackage() {
      bitField0_ &= ~0x00000040;
      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_ |= 0x00000040;
      return nextPackage;
    }

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

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

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

    @Override
    public StarTowerInteractReq copyFrom(final StarTowerInteractReq other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        id = other.id;
        enterReq.copyFrom(other.enterReq);
        battleEndReq.copyFrom(other.battleEndReq);
        selectReq.copyFrom(other.selectReq);
        recoveryHPReq.copyFrom(other.recoveryHPReq);
        hawkerReq.copyFrom(other.hawkerReq);
        nextPackage.copyFrom(other.nextPackage);
      }
      return this;
    }

    @Override
    public StarTowerInteractReq mergeFrom(final StarTowerInteractReq other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasId()) {
        setId(other.id);
      }
      if (other.hasEnterReq()) {
        getMutableEnterReq().mergeFrom(other.enterReq);
      }
      if (other.hasBattleEndReq()) {
        getMutableBattleEndReq().mergeFrom(other.battleEndReq);
      }
      if (other.hasSelectReq()) {
        getMutableSelectReq().mergeFrom(other.selectReq);
      }
      if (other.hasRecoveryHPReq()) {
        getMutableRecoveryHPReq().mergeFrom(other.recoveryHPReq);
      }
      if (other.hasHawkerReq()) {
        getMutableHawkerReq().mergeFrom(other.hawkerReq);
      }
      if (other.hasNextPackage()) {
        getMutableNextPackage().copyFrom(other.nextPackage);
      }
      return this;
    }

    @Override
    public StarTowerInteractReq clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      id = 0;
      enterReq.clear();
      battleEndReq.clear();
      selectReq.clear();
      recoveryHPReq.clear();
      hawkerReq.clear();
      nextPackage.clear();
      return this;
    }

    @Override
    public StarTowerInteractReq clearQuick() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      enterReq.clearQuick();
      battleEndReq.clearQuick();
      selectReq.clearQuick();
      recoveryHPReq.clearQuick();
      hawkerReq.clearQuick();
      nextPackage.clear();
      return this;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof StarTowerInteractReq)) {
        return false;
      }
      StarTowerInteractReq other = (StarTowerInteractReq) o;
      return bitField0_ == other.bitField0_
        && (!hasId() || id == other.id)
        && (!hasEnterReq() || enterReq.equals(other.enterReq))
        && (!hasBattleEndReq() || battleEndReq.equals(other.battleEndReq))
        && (!hasSelectReq() || selectReq.equals(other.selectReq))
        && (!hasRecoveryHPReq() || recoveryHPReq.equals(other.recoveryHPReq))
        && (!hasHawkerReq() || hawkerReq.equals(other.hawkerReq))
        && (!hasNextPackage() || nextPackage.equals(other.nextPackage));
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawByte((byte) 8);
        output.writeUInt32NoTag(id);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRawByte((byte) 18);
        output.writeMessageNoTag(enterReq);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRawByte((byte) 26);
        output.writeMessageNoTag(battleEndReq);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeRawByte((byte) 34);
        output.writeMessageNoTag(selectReq);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeRawByte((byte) 42);
        output.writeMessageNoTag(recoveryHPReq);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        output.writeRawByte((byte) 50);
        output.writeMessageNoTag(hawkerReq);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        output.writeRawLittleEndian16((short) 32762);
        output.writeBytesNoTag(nextPackage);
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(id);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += 1 + ProtoSink.computeMessageSizeNoTag(enterReq);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        size += 1 + ProtoSink.computeMessageSizeNoTag(battleEndReq);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        size += 1 + ProtoSink.computeMessageSizeNoTag(selectReq);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        size += 1 + ProtoSink.computeMessageSizeNoTag(recoveryHPReq);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        size += 1 + ProtoSink.computeMessageSizeNoTag(hawkerReq);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        size += 2 + ProtoSink.computeBytesSizeNoTag(nextPackage);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public StarTowerInteractReq mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 8: {
            // id
            id = input.readUInt32();
            bitField0_ |= 0x00000001;
            tag = input.readTag();
            if (tag != 18) {
              break;
            }
          }
          case 18: {
            // enterReq
            input.readMessage(enterReq);
            bitField0_ |= 0x00000002;
            tag = input.readTag();
            if (tag != 26) {
              break;
            }
          }
          case 26: {
            // battleEndReq
            input.readMessage(battleEndReq);
            bitField0_ |= 0x00000004;
            tag = input.readTag();
            if (tag != 34) {
              break;
            }
          }
          case 34: {
            // selectReq
            input.readMessage(selectReq);
            bitField0_ |= 0x00000008;
            tag = input.readTag();
            if (tag != 42) {
              break;
            }
          }
          case 42: {
            // recoveryHPReq
            input.readMessage(recoveryHPReq);
            bitField0_ |= 0x00000010;
            tag = input.readTag();
            if (tag != 50) {
              break;
            }
          }
          case 50: {
            // hawkerReq
            input.readMessage(hawkerReq);
            bitField0_ |= 0x00000020;
            tag = input.readTag();
            if (tag != 16378) {
              break;
            }
          }
          case 16378: {
            // nextPackage
            input.readBytes(nextPackage);
            bitField0_ |= 0x00000040;
            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.id, id);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeMessage(FieldNames.enterReq, enterReq);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeMessage(FieldNames.battleEndReq, battleEndReq);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeMessage(FieldNames.selectReq, selectReq);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeMessage(FieldNames.recoveryHPReq, recoveryHPReq);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        output.writeMessage(FieldNames.hawkerReq, hawkerReq);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        output.writeBytes(FieldNames.nextPackage, nextPackage);
      }
      output.endObject();
    }

    @Override
    public StarTowerInteractReq mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case 2363: {
            if (input.isAtField(FieldNames.id)) {
              if (!input.trySkipNullValue()) {
                id = input.readUInt32();
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -2041246010: {
            if (input.isAtField(FieldNames.enterReq)) {
              if (!input.trySkipNullValue()) {
                input.readMessage(enterReq);
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 1955425467: {
            if (input.isAtField(FieldNames.battleEndReq)) {
              if (!input.trySkipNullValue()) {
                input.readMessage(battleEndReq);
                bitField0_ |= 0x00000004;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 287980002: {
            if (input.isAtField(FieldNames.selectReq)) {
              if (!input.trySkipNullValue()) {
                input.readMessage(selectReq);
                bitField0_ |= 0x00000008;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1546231839: {
            if (input.isAtField(FieldNames.recoveryHPReq)) {
              if (!input.trySkipNullValue()) {
                input.readMessage(recoveryHPReq);
                bitField0_ |= 0x00000010;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 1660004132: {
            if (input.isAtField(FieldNames.hawkerReq)) {
              if (!input.trySkipNullValue()) {
                input.readMessage(hawkerReq);
                bitField0_ |= 0x00000020;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -2082324045: {
            if (input.isAtField(FieldNames.nextPackage)) {
              if (!input.trySkipNullValue()) {
                input.readBytes(nextPackage);
                bitField0_ |= 0x00000040;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    private enum StarTowerInteractReqFactory implements MessageFactory<StarTowerInteractReq> {
      INSTANCE;

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

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

      static final FieldName enterReq = FieldName.forField("EnterReq");

      static final FieldName battleEndReq = FieldName.forField("BattleEndReq");

      static final FieldName selectReq = FieldName.forField("SelectReq");

      static final FieldName recoveryHPReq = FieldName.forField("RecoveryHPReq");

      static final FieldName hawkerReq = FieldName.forField("HawkerReq");

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

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

    /**
     * <code>optional uint32 Id = 1;</code>
     */
    private int id;

    /**
     * <code>optional .ChangeInfo Change = 3;</code>
     */
    private final Public.ChangeInfo change = Public.ChangeInfo.newInstance();

    /**
     * <code>optional .TowerChangeData Data = 4;</code>
     */
    private final PublicStarTower.TowerChangeData data = PublicStarTower.TowerChangeData.newInstance();

    /**
     * <code>optional .InteractEnterResp EnterResp = 7;</code>
     */
    private final PublicStarTower.InteractEnterResp enterResp = PublicStarTower.InteractEnterResp.newInstance();

    /**
     * <code>optional .InteractBattleEndResp BattleEndResp = 8;</code>
     */
    private final PublicStarTower.InteractBattleEndResp battleEndResp = PublicStarTower.InteractBattleEndResp.newInstance();

    /**
     * <code>optional .InteractSelectResp SelectResp = 9;</code>
     */
    private final PublicStarTower.InteractSelectResp selectResp = PublicStarTower.InteractSelectResp.newInstance();

    /**
     * <code>optional .InteractStrengthenMachineResp StrengthenMachineResp = 10;</code>
     */
    private final PublicStarTower.InteractStrengthenMachineResp strengthenMachineResp = PublicStarTower.InteractStrengthenMachineResp.newInstance();

    /**
     * <code>optional .SettleDataResp Settle = 14;</code>
     */
    private final PublicStarTower.SettleDataResp settle = PublicStarTower.SettleDataResp.newInstance();

    /**
     * <code>optional .Nil NilResp = 15;</code>
     */
    private final Public.Nil nilResp = Public.Nil.newInstance();

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

    /**
     * <code>repeated .StarTowerRoomCase Cases = 2;</code>
     */
    private final RepeatedMessage<PublicStarTower.StarTowerRoomCase> cases = RepeatedMessage.newEmptyInstance(PublicStarTower.StarTowerRoomCase.getFactory());

    private StarTowerInteractResp() {
    }

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

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

    /**
     * <code>optional uint32 Id = 1;</code>
     * @return this
     */
    public StarTowerInteractResp clearId() {
      bitField0_ &= ~0x00000001;
      id = 0;
      return this;
    }

    /**
     * <code>optional uint32 Id = 1;</code>
     * @return the id
     */
    public int getId() {
      return id;
    }

    /**
     * <code>optional uint32 Id = 1;</code>
     * @param value the id to set
     * @return this
     */
    public StarTowerInteractResp setId(final int value) {
      bitField0_ |= 0x00000001;
      id = value;
      return this;
    }

    /**
     * <code>optional .ChangeInfo Change = 3;</code>
     * @return whether the change field is set
     */
    public boolean hasChange() {
      return (bitField0_ & 0x00000002) != 0;
    }

    /**
     * <code>optional .ChangeInfo Change = 3;</code>
     * @return this
     */
    public StarTowerInteractResp clearChange() {
      bitField0_ &= ~0x00000002;
      change.clear();
      return this;
    }

    /**
     * <code>optional .ChangeInfo Change = 3;</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 #getMutableChange()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public Public.ChangeInfo getChange() {
      return change;
    }

    /**
     * <code>optional .ChangeInfo Change = 3;</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 Public.ChangeInfo getMutableChange() {
      bitField0_ |= 0x00000002;
      return change;
    }

    /**
     * <code>optional .ChangeInfo Change = 3;</code>
     * @param value the change to set
     * @return this
     */
    public StarTowerInteractResp setChange(final Public.ChangeInfo value) {
      bitField0_ |= 0x00000002;
      change.copyFrom(value);
      return this;
    }

    /**
     * <code>optional .TowerChangeData Data = 4;</code>
     * @return whether the data field is set
     */
    public boolean hasData() {
      return (bitField0_ & 0x00000004) != 0;
    }

    /**
     * <code>optional .TowerChangeData Data = 4;</code>
     * @return this
     */
    public StarTowerInteractResp clearData() {
      bitField0_ &= ~0x00000004;
      data.clear();
      return this;
    }

    /**
     * <code>optional .TowerChangeData Data = 4;</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 #getMutableData()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public PublicStarTower.TowerChangeData getData() {
      return data;
    }

    /**
     * <code>optional .TowerChangeData Data = 4;</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 PublicStarTower.TowerChangeData getMutableData() {
      bitField0_ |= 0x00000004;
      return data;
    }

    /**
     * <code>optional .TowerChangeData Data = 4;</code>
     * @param value the data to set
     * @return this
     */
    public StarTowerInteractResp setData(final PublicStarTower.TowerChangeData value) {
      bitField0_ |= 0x00000004;
      data.copyFrom(value);
      return this;
    }

    /**
     * <code>optional .InteractEnterResp EnterResp = 7;</code>
     * @return whether the enterResp field is set
     */
    public boolean hasEnterResp() {
      return (bitField0_ & 0x00000008) != 0;
    }

    /**
     * <code>optional .InteractEnterResp EnterResp = 7;</code>
     * @return this
     */
    public StarTowerInteractResp clearEnterResp() {
      bitField0_ &= ~0x00000008;
      enterResp.clear();
      return this;
    }

    /**
     * <code>optional .InteractEnterResp EnterResp = 7;</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 #getMutableEnterResp()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public PublicStarTower.InteractEnterResp getEnterResp() {
      return enterResp;
    }

    /**
     * <code>optional .InteractEnterResp EnterResp = 7;</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 PublicStarTower.InteractEnterResp getMutableEnterResp() {
      bitField0_ |= 0x00000008;
      return enterResp;
    }

    /**
     * <code>optional .InteractEnterResp EnterResp = 7;</code>
     * @param value the enterResp to set
     * @return this
     */
    public StarTowerInteractResp setEnterResp(final PublicStarTower.InteractEnterResp value) {
      bitField0_ |= 0x00000008;
      enterResp.copyFrom(value);
      return this;
    }

    /**
     * <code>optional .InteractBattleEndResp BattleEndResp = 8;</code>
     * @return whether the battleEndResp field is set
     */
    public boolean hasBattleEndResp() {
      return (bitField0_ & 0x00000010) != 0;
    }

    /**
     * <code>optional .InteractBattleEndResp BattleEndResp = 8;</code>
     * @return this
     */
    public StarTowerInteractResp clearBattleEndResp() {
      bitField0_ &= ~0x00000010;
      battleEndResp.clear();
      return this;
    }

    /**
     * <code>optional .InteractBattleEndResp BattleEndResp = 8;</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 #getMutableBattleEndResp()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public PublicStarTower.InteractBattleEndResp getBattleEndResp() {
      return battleEndResp;
    }

    /**
     * <code>optional .InteractBattleEndResp BattleEndResp = 8;</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 PublicStarTower.InteractBattleEndResp getMutableBattleEndResp() {
      bitField0_ |= 0x00000010;
      return battleEndResp;
    }

    /**
     * <code>optional .InteractBattleEndResp BattleEndResp = 8;</code>
     * @param value the battleEndResp to set
     * @return this
     */
    public StarTowerInteractResp setBattleEndResp(
        final PublicStarTower.InteractBattleEndResp value) {
      bitField0_ |= 0x00000010;
      battleEndResp.copyFrom(value);
      return this;
    }

    /**
     * <code>optional .InteractSelectResp SelectResp = 9;</code>
     * @return whether the selectResp field is set
     */
    public boolean hasSelectResp() {
      return (bitField0_ & 0x00000020) != 0;
    }

    /**
     * <code>optional .InteractSelectResp SelectResp = 9;</code>
     * @return this
     */
    public StarTowerInteractResp clearSelectResp() {
      bitField0_ &= ~0x00000020;
      selectResp.clear();
      return this;
    }

    /**
     * <code>optional .InteractSelectResp SelectResp = 9;</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 #getMutableSelectResp()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public PublicStarTower.InteractSelectResp getSelectResp() {
      return selectResp;
    }

    /**
     * <code>optional .InteractSelectResp SelectResp = 9;</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 PublicStarTower.InteractSelectResp getMutableSelectResp() {
      bitField0_ |= 0x00000020;
      return selectResp;
    }

    /**
     * <code>optional .InteractSelectResp SelectResp = 9;</code>
     * @param value the selectResp to set
     * @return this
     */
    public StarTowerInteractResp setSelectResp(final PublicStarTower.InteractSelectResp value) {
      bitField0_ |= 0x00000020;
      selectResp.copyFrom(value);
      return this;
    }

    /**
     * <code>optional .InteractStrengthenMachineResp StrengthenMachineResp = 10;</code>
     * @return whether the strengthenMachineResp field is set
     */
    public boolean hasStrengthenMachineResp() {
      return (bitField0_ & 0x00000040) != 0;
    }

    /**
     * <code>optional .InteractStrengthenMachineResp StrengthenMachineResp = 10;</code>
     * @return this
     */
    public StarTowerInteractResp clearStrengthenMachineResp() {
      bitField0_ &= ~0x00000040;
      strengthenMachineResp.clear();
      return this;
    }

    /**
     * <code>optional .InteractStrengthenMachineResp StrengthenMachineResp = 10;</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 #getMutableStrengthenMachineResp()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public PublicStarTower.InteractStrengthenMachineResp getStrengthenMachineResp() {
      return strengthenMachineResp;
    }

    /**
     * <code>optional .InteractStrengthenMachineResp StrengthenMachineResp = 10;</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 PublicStarTower.InteractStrengthenMachineResp getMutableStrengthenMachineResp() {
      bitField0_ |= 0x00000040;
      return strengthenMachineResp;
    }

    /**
     * <code>optional .InteractStrengthenMachineResp StrengthenMachineResp = 10;</code>
     * @param value the strengthenMachineResp to set
     * @return this
     */
    public StarTowerInteractResp setStrengthenMachineResp(
        final PublicStarTower.InteractStrengthenMachineResp value) {
      bitField0_ |= 0x00000040;
      strengthenMachineResp.copyFrom(value);
      return this;
    }

    /**
     * <code>optional .SettleDataResp Settle = 14;</code>
     * @return whether the settle field is set
     */
    public boolean hasSettle() {
      return (bitField0_ & 0x00000080) != 0;
    }

    /**
     * <code>optional .SettleDataResp Settle = 14;</code>
     * @return this
     */
    public StarTowerInteractResp clearSettle() {
      bitField0_ &= ~0x00000080;
      settle.clear();
      return this;
    }

    /**
     * <code>optional .SettleDataResp Settle = 14;</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 #getMutableSettle()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public PublicStarTower.SettleDataResp getSettle() {
      return settle;
    }

    /**
     * <code>optional .SettleDataResp Settle = 14;</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 PublicStarTower.SettleDataResp getMutableSettle() {
      bitField0_ |= 0x00000080;
      return settle;
    }

    /**
     * <code>optional .SettleDataResp Settle = 14;</code>
     * @param value the settle to set
     * @return this
     */
    public StarTowerInteractResp setSettle(final PublicStarTower.SettleDataResp value) {
      bitField0_ |= 0x00000080;
      settle.copyFrom(value);
      return this;
    }

    /**
     * <code>optional .Nil NilResp = 15;</code>
     * @return whether the nilResp field is set
     */
    public boolean hasNilResp() {
      return (bitField0_ & 0x00000100) != 0;
    }

    /**
     * <code>optional .Nil NilResp = 15;</code>
     * @return this
     */
    public StarTowerInteractResp clearNilResp() {
      bitField0_ &= ~0x00000100;
      nilResp.clear();
      return this;
    }

    /**
     * <code>optional .Nil NilResp = 15;</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 #getMutableNilResp()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public Public.Nil getNilResp() {
      return nilResp;
    }

    /**
     * <code>optional .Nil NilResp = 15;</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 Public.Nil getMutableNilResp() {
      bitField0_ |= 0x00000100;
      return nilResp;
    }

    /**
     * <code>optional .Nil NilResp = 15;</code>
     * @param value the nilResp to set
     * @return this
     */
    public StarTowerInteractResp setNilResp(final Public.Nil value) {
      bitField0_ |= 0x00000100;
      nilResp.copyFrom(value);
      return this;
    }

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

    /**
     * <code>optional bytes NextPackage = 2047;</code>
     * @return this
     */
    public StarTowerInteractResp clearNextPackage() {
      bitField0_ &= ~0x00000200;
      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_ |= 0x00000200;
      return nextPackage;
    }

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

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

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

    /**
     * <code>repeated .StarTowerRoomCase Cases = 2;</code>
     * @return whether the cases field is set
     */
    public boolean hasCases() {
      return (bitField0_ & 0x00000400) != 0;
    }

    /**
     * <code>repeated .StarTowerRoomCase Cases = 2;</code>
     * @return this
     */
    public StarTowerInteractResp clearCases() {
      bitField0_ &= ~0x00000400;
      cases.clear();
      return this;
    }

    /**
     * <code>repeated .StarTowerRoomCase Cases = 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 #getMutableCases()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedMessage<PublicStarTower.StarTowerRoomCase> getCases() {
      return cases;
    }

    /**
     * <code>repeated .StarTowerRoomCase Cases = 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<PublicStarTower.StarTowerRoomCase> getMutableCases() {
      bitField0_ |= 0x00000400;
      return cases;
    }

    /**
     * <code>repeated .StarTowerRoomCase Cases = 2;</code>
     * @param value the cases to add
     * @return this
     */
    public StarTowerInteractResp addCases(final PublicStarTower.StarTowerRoomCase value) {
      bitField0_ |= 0x00000400;
      cases.add(value);
      return this;
    }

    /**
     * <code>repeated .StarTowerRoomCase Cases = 2;</code>
     * @param values the cases to add
     * @return this
     */
    public StarTowerInteractResp addAllCases(final PublicStarTower.StarTowerRoomCase... values) {
      bitField0_ |= 0x00000400;
      cases.addAll(values);
      return this;
    }

    @Override
    public StarTowerInteractResp copyFrom(final StarTowerInteractResp other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        id = other.id;
        change.copyFrom(other.change);
        data.copyFrom(other.data);
        enterResp.copyFrom(other.enterResp);
        battleEndResp.copyFrom(other.battleEndResp);
        selectResp.copyFrom(other.selectResp);
        strengthenMachineResp.copyFrom(other.strengthenMachineResp);
        settle.copyFrom(other.settle);
        nilResp.copyFrom(other.nilResp);
        nextPackage.copyFrom(other.nextPackage);
        cases.copyFrom(other.cases);
      }
      return this;
    }

    @Override
    public StarTowerInteractResp mergeFrom(final StarTowerInteractResp other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasId()) {
        setId(other.id);
      }
      if (other.hasChange()) {
        getMutableChange().mergeFrom(other.change);
      }
      if (other.hasData()) {
        getMutableData().mergeFrom(other.data);
      }
      if (other.hasEnterResp()) {
        getMutableEnterResp().mergeFrom(other.enterResp);
      }
      if (other.hasBattleEndResp()) {
        getMutableBattleEndResp().mergeFrom(other.battleEndResp);
      }
      if (other.hasSelectResp()) {
        getMutableSelectResp().mergeFrom(other.selectResp);
      }
      if (other.hasStrengthenMachineResp()) {
        getMutableStrengthenMachineResp().mergeFrom(other.strengthenMachineResp);
      }
      if (other.hasSettle()) {
        getMutableSettle().mergeFrom(other.settle);
      }
      if (other.hasNilResp()) {
        getMutableNilResp().mergeFrom(other.nilResp);
      }
      if (other.hasNextPackage()) {
        getMutableNextPackage().copyFrom(other.nextPackage);
      }
      if (other.hasCases()) {
        getMutableCases().addAll(other.cases);
      }
      return this;
    }

    @Override
    public StarTowerInteractResp clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      id = 0;
      change.clear();
      data.clear();
      enterResp.clear();
      battleEndResp.clear();
      selectResp.clear();
      strengthenMachineResp.clear();
      settle.clear();
      nilResp.clear();
      nextPackage.clear();
      cases.clear();
      return this;
    }

    @Override
    public StarTowerInteractResp clearQuick() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      change.clearQuick();
      data.clearQuick();
      enterResp.clearQuick();
      battleEndResp.clearQuick();
      selectResp.clearQuick();
      strengthenMachineResp.clearQuick();
      settle.clearQuick();
      nilResp.clearQuick();
      nextPackage.clear();
      cases.clearQuick();
      return this;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof StarTowerInteractResp)) {
        return false;
      }
      StarTowerInteractResp other = (StarTowerInteractResp) o;
      return bitField0_ == other.bitField0_
        && (!hasId() || id == other.id)
        && (!hasChange() || change.equals(other.change))
        && (!hasData() || data.equals(other.data))
        && (!hasEnterResp() || enterResp.equals(other.enterResp))
        && (!hasBattleEndResp() || battleEndResp.equals(other.battleEndResp))
        && (!hasSelectResp() || selectResp.equals(other.selectResp))
        && (!hasStrengthenMachineResp() || strengthenMachineResp.equals(other.strengthenMachineResp))
        && (!hasSettle() || settle.equals(other.settle))
        && (!hasNilResp() || nilResp.equals(other.nilResp))
        && (!hasNextPackage() || nextPackage.equals(other.nextPackage))
        && (!hasCases() || cases.equals(other.cases));
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawByte((byte) 8);
        output.writeUInt32NoTag(id);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRawByte((byte) 26);
        output.writeMessageNoTag(change);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRawByte((byte) 34);
        output.writeMessageNoTag(data);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeRawByte((byte) 58);
        output.writeMessageNoTag(enterResp);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeRawByte((byte) 66);
        output.writeMessageNoTag(battleEndResp);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        output.writeRawByte((byte) 74);
        output.writeMessageNoTag(selectResp);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        output.writeRawByte((byte) 82);
        output.writeMessageNoTag(strengthenMachineResp);
      }
      if ((bitField0_ & 0x00000080) != 0) {
        output.writeRawByte((byte) 114);
        output.writeMessageNoTag(settle);
      }
      if ((bitField0_ & 0x00000100) != 0) {
        output.writeRawByte((byte) 122);
        output.writeMessageNoTag(nilResp);
      }
      if ((bitField0_ & 0x00000200) != 0) {
        output.writeRawLittleEndian16((short) 32762);
        output.writeBytesNoTag(nextPackage);
      }
      if ((bitField0_ & 0x00000400) != 0) {
        for (int i = 0; i < cases.length(); i++) {
          output.writeRawByte((byte) 18);
          output.writeMessageNoTag(cases.get(i));
        }
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(id);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += 1 + ProtoSink.computeMessageSizeNoTag(change);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        size += 1 + ProtoSink.computeMessageSizeNoTag(data);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        size += 1 + ProtoSink.computeMessageSizeNoTag(enterResp);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        size += 1 + ProtoSink.computeMessageSizeNoTag(battleEndResp);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        size += 1 + ProtoSink.computeMessageSizeNoTag(selectResp);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        size += 1 + ProtoSink.computeMessageSizeNoTag(strengthenMachineResp);
      }
      if ((bitField0_ & 0x00000080) != 0) {
        size += 1 + ProtoSink.computeMessageSizeNoTag(settle);
      }
      if ((bitField0_ & 0x00000100) != 0) {
        size += 1 + ProtoSink.computeMessageSizeNoTag(nilResp);
      }
      if ((bitField0_ & 0x00000200) != 0) {
        size += 2 + ProtoSink.computeBytesSizeNoTag(nextPackage);
      }
      if ((bitField0_ & 0x00000400) != 0) {
        size += (1 * cases.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(cases);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public StarTowerInteractResp mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 8: {
            // id
            id = input.readUInt32();
            bitField0_ |= 0x00000001;
            tag = input.readTag();
            if (tag != 26) {
              break;
            }
          }
          case 26: {
            // change
            input.readMessage(change);
            bitField0_ |= 0x00000002;
            tag = input.readTag();
            if (tag != 34) {
              break;
            }
          }
          case 34: {
            // data
            input.readMessage(data);
            bitField0_ |= 0x00000004;
            tag = input.readTag();
            if (tag != 58) {
              break;
            }
          }
          case 58: {
            // enterResp
            input.readMessage(enterResp);
            bitField0_ |= 0x00000008;
            tag = input.readTag();
            if (tag != 66) {
              break;
            }
          }
          case 66: {
            // battleEndResp
            input.readMessage(battleEndResp);
            bitField0_ |= 0x00000010;
            tag = input.readTag();
            if (tag != 74) {
              break;
            }
          }
          case 74: {
            // selectResp
            input.readMessage(selectResp);
            bitField0_ |= 0x00000020;
            tag = input.readTag();
            if (tag != 82) {
              break;
            }
          }
          case 82: {
            // strengthenMachineResp
            input.readMessage(strengthenMachineResp);
            bitField0_ |= 0x00000040;
            tag = input.readTag();
            if (tag != 114) {
              break;
            }
          }
          case 114: {
            // settle
            input.readMessage(settle);
            bitField0_ |= 0x00000080;
            tag = input.readTag();
            if (tag != 122) {
              break;
            }
          }
          case 122: {
            // nilResp
            input.readMessage(nilResp);
            bitField0_ |= 0x00000100;
            tag = input.readTag();
            if (tag != 16378) {
              break;
            }
          }
          case 16378: {
            // nextPackage
            input.readBytes(nextPackage);
            bitField0_ |= 0x00000200;
            tag = input.readTag();
            if (tag != 18) {
              break;
            }
          }
          case 18: {
            // cases
            tag = input.readRepeatedMessage(cases, tag);
            bitField0_ |= 0x00000400;
            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.id, id);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeMessage(FieldNames.change, change);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeMessage(FieldNames.data, data);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeMessage(FieldNames.enterResp, enterResp);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeMessage(FieldNames.battleEndResp, battleEndResp);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        output.writeMessage(FieldNames.selectResp, selectResp);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        output.writeMessage(FieldNames.strengthenMachineResp, strengthenMachineResp);
      }
      if ((bitField0_ & 0x00000080) != 0) {
        output.writeMessage(FieldNames.settle, settle);
      }
      if ((bitField0_ & 0x00000100) != 0) {
        output.writeMessage(FieldNames.nilResp, nilResp);
      }
      if ((bitField0_ & 0x00000200) != 0) {
        output.writeBytes(FieldNames.nextPackage, nextPackage);
      }
      if ((bitField0_ & 0x00000400) != 0) {
        output.writeRepeatedMessage(FieldNames.cases, cases);
      }
      output.endObject();
    }

    @Override
    public StarTowerInteractResp mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case 2363: {
            if (input.isAtField(FieldNames.id)) {
              if (!input.trySkipNullValue()) {
                id = input.readUInt32();
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 2017198032: {
            if (input.isAtField(FieldNames.change)) {
              if (!input.trySkipNullValue()) {
                input.readMessage(change);
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 2122698: {
            if (input.isAtField(FieldNames.data)) {
              if (!input.trySkipNullValue()) {
                input.readMessage(data);
                bitField0_ |= 0x00000004;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 1145883304: {
            if (input.isAtField(FieldNames.enterResp)) {
              if (!input.trySkipNullValue()) {
                input.readMessage(enterResp);
                bitField0_ |= 0x00000008;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 488647507: {
            if (input.isAtField(FieldNames.battleEndResp)) {
              if (!input.trySkipNullValue()) {
                input.readMessage(battleEndResp);
                bitField0_ |= 0x00000010;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 337445644: {
            if (input.isAtField(FieldNames.selectResp)) {
              if (!input.trySkipNullValue()) {
                input.readMessage(selectResp);
                bitField0_ |= 0x00000020;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -788721267: {
            if (input.isAtField(FieldNames.strengthenMachineResp)) {
              if (!input.trySkipNullValue()) {
                input.readMessage(strengthenMachineResp);
                bitField0_ |= 0x00000040;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1821901461: {
            if (input.isAtField(FieldNames.settle)) {
              if (!input.trySkipNullValue()) {
                input.readMessage(settle);
                bitField0_ |= 0x00000080;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -680812191: {
            if (input.isAtField(FieldNames.nilResp)) {
              if (!input.trySkipNullValue()) {
                input.readMessage(nilResp);
                bitField0_ |= 0x00000100;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -2082324045: {
            if (input.isAtField(FieldNames.nextPackage)) {
              if (!input.trySkipNullValue()) {
                input.readBytes(nextPackage);
                bitField0_ |= 0x00000200;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 64879395: {
            if (input.isAtField(FieldNames.cases)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedMessage(cases);
                bitField0_ |= 0x00000400;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    private enum StarTowerInteractRespFactory implements MessageFactory<StarTowerInteractResp> {
      INSTANCE;

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

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

      static final FieldName change = FieldName.forField("Change");

      static final FieldName data = FieldName.forField("Data");

      static final FieldName enterResp = FieldName.forField("EnterResp");

      static final FieldName battleEndResp = FieldName.forField("BattleEndResp");

      static final FieldName selectResp = FieldName.forField("SelectResp");

      static final FieldName strengthenMachineResp = FieldName.forField("StrengthenMachineResp");

      static final FieldName settle = FieldName.forField("Settle");

      static final FieldName nilResp = FieldName.forField("NilResp");

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

      static final FieldName cases = FieldName.forField("Cases");
    }
  }
}
