// Code generated by protocol buffer compiler. Do not edit!
package emu.lunarcore.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 PVEBattleResultCsReqOuterClass {
  /**
   * Protobuf type {@code PVEBattleResultCsReq}
   */
  public static final class PVEBattleResultCsReq extends ProtoMessage<PVEBattleResultCsReq> implements Cloneable {
    private static final long serialVersionUID = 0L;

    /**
     * <code>optional uint32 cost_time = 4;</code>
     */
    private int costTime;

    /**
     * <code>optional uint32 client_res_version = 12;</code>
     */
    private int clientResVersion;

    /**
     * <code>optional uint32 stage_id = 14;</code>
     */
    private int stageId;

    /**
     * <code>optional uint32 battle_id = 15;</code>
     */
    private int battleId;

    /**
     * <code>optional .BattleEndStatus end_status = 8;</code>
     */
    private int endStatus;

    /**
     * <code>optional bool is_ai_consider_ultra_skill = 9;</code>
     */
    private boolean isAiConsiderUltraSkill;

    /**
     * <code>optional .BattleStatistics stt = 3;</code>
     */
    private final BattleStatisticsOuterClass.BattleStatistics stt = BattleStatisticsOuterClass.BattleStatistics.newInstance();

    /**
     * <code>optional bytes turn_snapshot_hash = 13;</code>
     */
    private final RepeatedByte turnSnapshotHash = RepeatedByte.newEmptyInstance();

    /**
     * <code>repeated .BattleOp op_list = 2;</code>
     */
    private final RepeatedMessage<BattleOpOuterClass.BattleOp> opList = RepeatedMessage.newEmptyInstance(BattleOpOuterClass.BattleOp.getFactory());

    private PVEBattleResultCsReq() {
    }

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

    /**
     * <code>optional uint32 cost_time = 4;</code>
     * @return whether the costTime field is set
     */
    public boolean hasCostTime() {
      return (bitField0_ & 0x00000001) != 0;
    }

    /**
     * <code>optional uint32 cost_time = 4;</code>
     * @return this
     */
    public PVEBattleResultCsReq clearCostTime() {
      bitField0_ &= ~0x00000001;
      costTime = 0;
      return this;
    }

    /**
     * <code>optional uint32 cost_time = 4;</code>
     * @return the costTime
     */
    public int getCostTime() {
      return costTime;
    }

    /**
     * <code>optional uint32 cost_time = 4;</code>
     * @param value the costTime to set
     * @return this
     */
    public PVEBattleResultCsReq setCostTime(final int value) {
      bitField0_ |= 0x00000001;
      costTime = value;
      return this;
    }

    /**
     * <code>optional uint32 client_res_version = 12;</code>
     * @return whether the clientResVersion field is set
     */
    public boolean hasClientResVersion() {
      return (bitField0_ & 0x00000002) != 0;
    }

    /**
     * <code>optional uint32 client_res_version = 12;</code>
     * @return this
     */
    public PVEBattleResultCsReq clearClientResVersion() {
      bitField0_ &= ~0x00000002;
      clientResVersion = 0;
      return this;
    }

    /**
     * <code>optional uint32 client_res_version = 12;</code>
     * @return the clientResVersion
     */
    public int getClientResVersion() {
      return clientResVersion;
    }

    /**
     * <code>optional uint32 client_res_version = 12;</code>
     * @param value the clientResVersion to set
     * @return this
     */
    public PVEBattleResultCsReq setClientResVersion(final int value) {
      bitField0_ |= 0x00000002;
      clientResVersion = value;
      return this;
    }

    /**
     * <code>optional uint32 stage_id = 14;</code>
     * @return whether the stageId field is set
     */
    public boolean hasStageId() {
      return (bitField0_ & 0x00000004) != 0;
    }

    /**
     * <code>optional uint32 stage_id = 14;</code>
     * @return this
     */
    public PVEBattleResultCsReq clearStageId() {
      bitField0_ &= ~0x00000004;
      stageId = 0;
      return this;
    }

    /**
     * <code>optional uint32 stage_id = 14;</code>
     * @return the stageId
     */
    public int getStageId() {
      return stageId;
    }

    /**
     * <code>optional uint32 stage_id = 14;</code>
     * @param value the stageId to set
     * @return this
     */
    public PVEBattleResultCsReq setStageId(final int value) {
      bitField0_ |= 0x00000004;
      stageId = value;
      return this;
    }

    /**
     * <code>optional uint32 battle_id = 15;</code>
     * @return whether the battleId field is set
     */
    public boolean hasBattleId() {
      return (bitField0_ & 0x00000008) != 0;
    }

    /**
     * <code>optional uint32 battle_id = 15;</code>
     * @return this
     */
    public PVEBattleResultCsReq clearBattleId() {
      bitField0_ &= ~0x00000008;
      battleId = 0;
      return this;
    }

    /**
     * <code>optional uint32 battle_id = 15;</code>
     * @return the battleId
     */
    public int getBattleId() {
      return battleId;
    }

    /**
     * <code>optional uint32 battle_id = 15;</code>
     * @param value the battleId to set
     * @return this
     */
    public PVEBattleResultCsReq setBattleId(final int value) {
      bitField0_ |= 0x00000008;
      battleId = value;
      return this;
    }

    /**
     * <code>optional .BattleEndStatus end_status = 8;</code>
     * @return whether the endStatus field is set
     */
    public boolean hasEndStatus() {
      return (bitField0_ & 0x00000010) != 0;
    }

    /**
     * <code>optional .BattleEndStatus end_status = 8;</code>
     * @return this
     */
    public PVEBattleResultCsReq clearEndStatus() {
      bitField0_ &= ~0x00000010;
      endStatus = 0;
      return this;
    }

    /**
     * <code>optional .BattleEndStatus end_status = 8;</code>
     * @return the endStatus
     */
    public BattleEndStatusOuterClass.BattleEndStatus getEndStatus() {
      return BattleEndStatusOuterClass.BattleEndStatus.forNumber(endStatus);
    }

    /**
     * Gets the value of the internal enum store. The result is
     * equivalent to {@link PVEBattleResultCsReq#getEndStatus()}.getNumber().
     *
     * @return numeric wire representation
     */
    public int getEndStatusValue() {
      return endStatus;
    }

    /**
     * Sets the value of the internal enum store. This does not
     * do any validity checks, so be sure to use appropriate value
     * constants from {@link BattleEndStatusOuterClass.BattleEndStatus}. Setting an invalid value
     * can cause {@link PVEBattleResultCsReq#getEndStatus()} to return null
     *
     * @param value the numeric wire value to set
     * @return this
     */
    public PVEBattleResultCsReq setEndStatusValue(final int value) {
      bitField0_ |= 0x00000010;
      endStatus = value;
      return this;
    }

    /**
     * <code>optional .BattleEndStatus end_status = 8;</code>
     * @param value the endStatus to set
     * @return this
     */
    public PVEBattleResultCsReq setEndStatus(
        final BattleEndStatusOuterClass.BattleEndStatus value) {
      bitField0_ |= 0x00000010;
      endStatus = value.getNumber();
      return this;
    }

    /**
     * <code>optional bool is_ai_consider_ultra_skill = 9;</code>
     * @return whether the isAiConsiderUltraSkill field is set
     */
    public boolean hasIsAiConsiderUltraSkill() {
      return (bitField0_ & 0x00000020) != 0;
    }

    /**
     * <code>optional bool is_ai_consider_ultra_skill = 9;</code>
     * @return this
     */
    public PVEBattleResultCsReq clearIsAiConsiderUltraSkill() {
      bitField0_ &= ~0x00000020;
      isAiConsiderUltraSkill = false;
      return this;
    }

    /**
     * <code>optional bool is_ai_consider_ultra_skill = 9;</code>
     * @return the isAiConsiderUltraSkill
     */
    public boolean getIsAiConsiderUltraSkill() {
      return isAiConsiderUltraSkill;
    }

    /**
     * <code>optional bool is_ai_consider_ultra_skill = 9;</code>
     * @param value the isAiConsiderUltraSkill to set
     * @return this
     */
    public PVEBattleResultCsReq setIsAiConsiderUltraSkill(final boolean value) {
      bitField0_ |= 0x00000020;
      isAiConsiderUltraSkill = value;
      return this;
    }

    /**
     * <code>optional .BattleStatistics stt = 3;</code>
     * @return whether the stt field is set
     */
    public boolean hasStt() {
      return (bitField0_ & 0x00000040) != 0;
    }

    /**
     * <code>optional .BattleStatistics stt = 3;</code>
     * @return this
     */
    public PVEBattleResultCsReq clearStt() {
      bitField0_ &= ~0x00000040;
      stt.clear();
      return this;
    }

    /**
     * <code>optional .BattleStatistics stt = 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 #getMutableStt()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public BattleStatisticsOuterClass.BattleStatistics getStt() {
      return stt;
    }

    /**
     * <code>optional .BattleStatistics stt = 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 BattleStatisticsOuterClass.BattleStatistics getMutableStt() {
      bitField0_ |= 0x00000040;
      return stt;
    }

    /**
     * <code>optional .BattleStatistics stt = 3;</code>
     * @param value the stt to set
     * @return this
     */
    public PVEBattleResultCsReq setStt(final BattleStatisticsOuterClass.BattleStatistics value) {
      bitField0_ |= 0x00000040;
      stt.copyFrom(value);
      return this;
    }

    /**
     * <code>optional bytes turn_snapshot_hash = 13;</code>
     * @return whether the turnSnapshotHash field is set
     */
    public boolean hasTurnSnapshotHash() {
      return (bitField0_ & 0x00000080) != 0;
    }

    /**
     * <code>optional bytes turn_snapshot_hash = 13;</code>
     * @return this
     */
    public PVEBattleResultCsReq clearTurnSnapshotHash() {
      bitField0_ &= ~0x00000080;
      turnSnapshotHash.clear();
      return this;
    }

    /**
     * <code>optional bytes turn_snapshot_hash = 13;</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 #getMutableTurnSnapshotHash()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedByte getTurnSnapshotHash() {
      return turnSnapshotHash;
    }

    /**
     * <code>optional bytes turn_snapshot_hash = 13;</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 getMutableTurnSnapshotHash() {
      bitField0_ |= 0x00000080;
      return turnSnapshotHash;
    }

    /**
     * <code>optional bytes turn_snapshot_hash = 13;</code>
     * @param value the turnSnapshotHash to add
     * @return this
     */
    public PVEBattleResultCsReq addTurnSnapshotHash(final byte value) {
      bitField0_ |= 0x00000080;
      turnSnapshotHash.add(value);
      return this;
    }

    /**
     * <code>optional bytes turn_snapshot_hash = 13;</code>
     * @param values the turnSnapshotHash to add
     * @return this
     */
    public PVEBattleResultCsReq addAllTurnSnapshotHash(final byte... values) {
      bitField0_ |= 0x00000080;
      turnSnapshotHash.addAll(values);
      return this;
    }

    /**
     * <code>optional bytes turn_snapshot_hash = 13;</code>
     * @param values the turnSnapshotHash to set
     * @return this
     */
    public PVEBattleResultCsReq setTurnSnapshotHash(final byte... values) {
      bitField0_ |= 0x00000080;
      turnSnapshotHash.copyFrom(values);
      return this;
    }

    /**
     * <code>repeated .BattleOp op_list = 2;</code>
     * @return whether the opList field is set
     */
    public boolean hasOpList() {
      return (bitField0_ & 0x00000100) != 0;
    }

    /**
     * <code>repeated .BattleOp op_list = 2;</code>
     * @return this
     */
    public PVEBattleResultCsReq clearOpList() {
      bitField0_ &= ~0x00000100;
      opList.clear();
      return this;
    }

    /**
     * <code>repeated .BattleOp op_list = 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 #getMutableOpList()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedMessage<BattleOpOuterClass.BattleOp> getOpList() {
      return opList;
    }

    /**
     * <code>repeated .BattleOp op_list = 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<BattleOpOuterClass.BattleOp> getMutableOpList() {
      bitField0_ |= 0x00000100;
      return opList;
    }

    /**
     * <code>repeated .BattleOp op_list = 2;</code>
     * @param value the opList to add
     * @return this
     */
    public PVEBattleResultCsReq addOpList(final BattleOpOuterClass.BattleOp value) {
      bitField0_ |= 0x00000100;
      opList.add(value);
      return this;
    }

    /**
     * <code>repeated .BattleOp op_list = 2;</code>
     * @param values the opList to add
     * @return this
     */
    public PVEBattleResultCsReq addAllOpList(final BattleOpOuterClass.BattleOp... values) {
      bitField0_ |= 0x00000100;
      opList.addAll(values);
      return this;
    }

    @Override
    public PVEBattleResultCsReq copyFrom(final PVEBattleResultCsReq other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        costTime = other.costTime;
        clientResVersion = other.clientResVersion;
        stageId = other.stageId;
        battleId = other.battleId;
        endStatus = other.endStatus;
        isAiConsiderUltraSkill = other.isAiConsiderUltraSkill;
        stt.copyFrom(other.stt);
        turnSnapshotHash.copyFrom(other.turnSnapshotHash);
        opList.copyFrom(other.opList);
      }
      return this;
    }

    @Override
    public PVEBattleResultCsReq mergeFrom(final PVEBattleResultCsReq other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasCostTime()) {
        setCostTime(other.costTime);
      }
      if (other.hasClientResVersion()) {
        setClientResVersion(other.clientResVersion);
      }
      if (other.hasStageId()) {
        setStageId(other.stageId);
      }
      if (other.hasBattleId()) {
        setBattleId(other.battleId);
      }
      if (other.hasEndStatus()) {
        setEndStatusValue(other.endStatus);
      }
      if (other.hasIsAiConsiderUltraSkill()) {
        setIsAiConsiderUltraSkill(other.isAiConsiderUltraSkill);
      }
      if (other.hasStt()) {
        getMutableStt().mergeFrom(other.stt);
      }
      if (other.hasTurnSnapshotHash()) {
        getMutableTurnSnapshotHash().copyFrom(other.turnSnapshotHash);
      }
      if (other.hasOpList()) {
        getMutableOpList().addAll(other.opList);
      }
      return this;
    }

    @Override
    public PVEBattleResultCsReq clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      costTime = 0;
      clientResVersion = 0;
      stageId = 0;
      battleId = 0;
      endStatus = 0;
      isAiConsiderUltraSkill = false;
      stt.clear();
      turnSnapshotHash.clear();
      opList.clear();
      return this;
    }

    @Override
    public PVEBattleResultCsReq clearQuick() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      stt.clearQuick();
      turnSnapshotHash.clear();
      opList.clearQuick();
      return this;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof PVEBattleResultCsReq)) {
        return false;
      }
      PVEBattleResultCsReq other = (PVEBattleResultCsReq) o;
      return bitField0_ == other.bitField0_
        && (!hasCostTime() || costTime == other.costTime)
        && (!hasClientResVersion() || clientResVersion == other.clientResVersion)
        && (!hasStageId() || stageId == other.stageId)
        && (!hasBattleId() || battleId == other.battleId)
        && (!hasEndStatus() || endStatus == other.endStatus)
        && (!hasIsAiConsiderUltraSkill() || isAiConsiderUltraSkill == other.isAiConsiderUltraSkill)
        && (!hasStt() || stt.equals(other.stt))
        && (!hasTurnSnapshotHash() || turnSnapshotHash.equals(other.turnSnapshotHash))
        && (!hasOpList() || opList.equals(other.opList));
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawByte((byte) 32);
        output.writeUInt32NoTag(costTime);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRawByte((byte) 96);
        output.writeUInt32NoTag(clientResVersion);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRawByte((byte) 112);
        output.writeUInt32NoTag(stageId);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeRawByte((byte) 120);
        output.writeUInt32NoTag(battleId);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeRawByte((byte) 64);
        output.writeEnumNoTag(endStatus);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        output.writeRawByte((byte) 72);
        output.writeBoolNoTag(isAiConsiderUltraSkill);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        output.writeRawByte((byte) 26);
        output.writeMessageNoTag(stt);
      }
      if ((bitField0_ & 0x00000080) != 0) {
        output.writeRawByte((byte) 106);
        output.writeBytesNoTag(turnSnapshotHash);
      }
      if ((bitField0_ & 0x00000100) != 0) {
        for (int i = 0; i < opList.length(); i++) {
          output.writeRawByte((byte) 18);
          output.writeMessageNoTag(opList.get(i));
        }
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(costTime);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(clientResVersion);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(stageId);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(battleId);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        size += 1 + ProtoSink.computeEnumSizeNoTag(endStatus);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        size += 2;
      }
      if ((bitField0_ & 0x00000040) != 0) {
        size += 1 + ProtoSink.computeMessageSizeNoTag(stt);
      }
      if ((bitField0_ & 0x00000080) != 0) {
        size += 1 + ProtoSink.computeBytesSizeNoTag(turnSnapshotHash);
      }
      if ((bitField0_ & 0x00000100) != 0) {
        size += (1 * opList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(opList);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public PVEBattleResultCsReq mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 32: {
            // costTime
            costTime = input.readUInt32();
            bitField0_ |= 0x00000001;
            tag = input.readTag();
            if (tag != 96) {
              break;
            }
          }
          case 96: {
            // clientResVersion
            clientResVersion = input.readUInt32();
            bitField0_ |= 0x00000002;
            tag = input.readTag();
            if (tag != 112) {
              break;
            }
          }
          case 112: {
            // stageId
            stageId = input.readUInt32();
            bitField0_ |= 0x00000004;
            tag = input.readTag();
            if (tag != 120) {
              break;
            }
          }
          case 120: {
            // battleId
            battleId = input.readUInt32();
            bitField0_ |= 0x00000008;
            tag = input.readTag();
            if (tag != 64) {
              break;
            }
          }
          case 64: {
            // endStatus
            final int value = input.readInt32();
            if (BattleEndStatusOuterClass.BattleEndStatus.forNumber(value) != null) {
              endStatus = value;
              bitField0_ |= 0x00000010;
            }
            tag = input.readTag();
            if (tag != 72) {
              break;
            }
          }
          case 72: {
            // isAiConsiderUltraSkill
            isAiConsiderUltraSkill = input.readBool();
            bitField0_ |= 0x00000020;
            tag = input.readTag();
            if (tag != 26) {
              break;
            }
          }
          case 26: {
            // stt
            input.readMessage(stt);
            bitField0_ |= 0x00000040;
            tag = input.readTag();
            if (tag != 106) {
              break;
            }
          }
          case 106: {
            // turnSnapshotHash
            input.readBytes(turnSnapshotHash);
            bitField0_ |= 0x00000080;
            tag = input.readTag();
            if (tag != 18) {
              break;
            }
          }
          case 18: {
            // opList
            tag = input.readRepeatedMessage(opList, tag);
            bitField0_ |= 0x00000100;
            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.costTime, costTime);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeUInt32(FieldNames.clientResVersion, clientResVersion);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeUInt32(FieldNames.stageId, stageId);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeUInt32(FieldNames.battleId, battleId);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeEnum(FieldNames.endStatus, endStatus, BattleEndStatusOuterClass.BattleEndStatus.converter());
      }
      if ((bitField0_ & 0x00000020) != 0) {
        output.writeBool(FieldNames.isAiConsiderUltraSkill, isAiConsiderUltraSkill);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        output.writeMessage(FieldNames.stt, stt);
      }
      if ((bitField0_ & 0x00000080) != 0) {
        output.writeBytes(FieldNames.turnSnapshotHash, turnSnapshotHash);
      }
      if ((bitField0_ & 0x00000100) != 0) {
        output.writeRepeatedMessage(FieldNames.opList, opList);
      }
      output.endObject();
    }

    @Override
    public PVEBattleResultCsReq mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case -424687558:
          case -269929473: {
            if (input.isAtField(FieldNames.costTime)) {
              if (!input.trySkipNullValue()) {
                costTime = input.readUInt32();
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -2005674429:
          case -349907515: {
            if (input.isAtField(FieldNames.clientResVersion)) {
              if (!input.trySkipNullValue()) {
                clientResVersion = input.readUInt32();
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1897528135:
          case 1306191356: {
            if (input.isAtField(FieldNames.stageId)) {
              if (!input.trySkipNullValue()) {
                stageId = input.readUInt32();
                bitField0_ |= 0x00000004;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1678308365:
          case -487930366: {
            if (input.isAtField(FieldNames.battleId)) {
              if (!input.trySkipNullValue()) {
                battleId = input.readUInt32();
                bitField0_ |= 0x00000008;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 1608709293:
          case 378841046: {
            if (input.isAtField(FieldNames.endStatus)) {
              if (!input.trySkipNullValue()) {
                final BattleEndStatusOuterClass.BattleEndStatus value = input.readEnum(BattleEndStatusOuterClass.BattleEndStatus.converter());
                if (value != null) {
                  endStatus = value.getNumber();
                  bitField0_ |= 0x00000010;
                } else {
                  input.skipUnknownEnumValue();
                }
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -792003792:
          case 524172826: {
            if (input.isAtField(FieldNames.isAiConsiderUltraSkill)) {
              if (!input.trySkipNullValue()) {
                isAiConsiderUltraSkill = input.readBool();
                bitField0_ |= 0x00000020;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 114227: {
            if (input.isAtField(FieldNames.stt)) {
              if (!input.trySkipNullValue()) {
                input.readMessage(stt);
                bitField0_ |= 0x00000040;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 716212751:
          case 397070951: {
            if (input.isAtField(FieldNames.turnSnapshotHash)) {
              if (!input.trySkipNullValue()) {
                input.readBytes(turnSnapshotHash);
                bitField0_ |= 0x00000080;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1011328481:
          case -1268785092: {
            if (input.isAtField(FieldNames.opList)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedMessage(opList);
                bitField0_ |= 0x00000100;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    private enum PVEBattleResultCsReqFactory implements MessageFactory<PVEBattleResultCsReq> {
      INSTANCE;

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

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

      static final FieldName clientResVersion = FieldName.forField("clientResVersion", "client_res_version");

      static final FieldName stageId = FieldName.forField("stageId", "stage_id");

      static final FieldName battleId = FieldName.forField("battleId", "battle_id");

      static final FieldName endStatus = FieldName.forField("endStatus", "end_status");

      static final FieldName isAiConsiderUltraSkill = FieldName.forField("isAiConsiderUltraSkill", "is_ai_consider_ultra_skill");

      static final FieldName stt = FieldName.forField("stt");

      static final FieldName turnSnapshotHash = FieldName.forField("turnSnapshotHash", "turn_snapshot_hash");

      static final FieldName opList = FieldName.forField("opList", "op_list");
    }
  }
}
