// 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.RepeatedMessage;
import us.hebi.quickbuf.Utf8String;

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

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

    /**
     * <code>optional uint32 mismatch_turn_count = 10;</code>
     */
    private int mismatchTurnCount;

    /**
     * <code>optional uint32 event_id = 12;</code>
     */
    private int eventId;

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

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

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

    /**
     * <code>optional bool check_identical = 8;</code>
     */
    private boolean checkIdentical;

    /**
     * <code>optional .ItemList drop_data = 5;</code>
     */
    private final ItemListOuterClass.ItemList dropData = ItemListOuterClass.ItemList.newInstance();

    /**
     * <code>optional .ItemList extra_drop_data = 6;</code>
     */
    private final ItemListOuterClass.ItemList extraDropData = ItemListOuterClass.ItemList.newInstance();

    /**
     * <code>optional .ItemList unk_item_list_2 = 7;</code>
     */
    private final ItemListOuterClass.ItemList unkItemList2 = ItemListOuterClass.ItemList.newInstance();

    /**
     * <code>optional .ItemList unk_item_list_3 = 460;</code>
     */
    private final ItemListOuterClass.ItemList unkItemList3 = ItemListOuterClass.ItemList.newInstance();

    /**
     * <code>optional string res_version = 2;</code>
     */
    private final Utf8String resVersion = Utf8String.newEmptyInstance();

    /**
     * <code>optional string bin_version = 15;</code>
     */
    private final Utf8String binVersion = Utf8String.newEmptyInstance();

    /**
     * <code>repeated .BattleAvatar battle_avatar_list = 9;</code>
     */
    private final RepeatedMessage<BattleAvatarOuterClass.BattleAvatar> battleAvatarList = RepeatedMessage.newEmptyInstance(BattleAvatarOuterClass.BattleAvatar.getFactory());

    private PVEBattleResultScRsp() {
    }

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

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

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

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

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

    /**
     * <code>optional uint32 mismatch_turn_count = 10;</code>
     * @return whether the mismatchTurnCount field is set
     */
    public boolean hasMismatchTurnCount() {
      return (bitField0_ & 0x00000002) != 0;
    }

    /**
     * <code>optional uint32 mismatch_turn_count = 10;</code>
     * @return this
     */
    public PVEBattleResultScRsp clearMismatchTurnCount() {
      bitField0_ &= ~0x00000002;
      mismatchTurnCount = 0;
      return this;
    }

    /**
     * <code>optional uint32 mismatch_turn_count = 10;</code>
     * @return the mismatchTurnCount
     */
    public int getMismatchTurnCount() {
      return mismatchTurnCount;
    }

    /**
     * <code>optional uint32 mismatch_turn_count = 10;</code>
     * @param value the mismatchTurnCount to set
     * @return this
     */
    public PVEBattleResultScRsp setMismatchTurnCount(final int value) {
      bitField0_ |= 0x00000002;
      mismatchTurnCount = value;
      return this;
    }

    /**
     * <code>optional uint32 event_id = 12;</code>
     * @return whether the eventId field is set
     */
    public boolean hasEventId() {
      return (bitField0_ & 0x00000004) != 0;
    }

    /**
     * <code>optional uint32 event_id = 12;</code>
     * @return this
     */
    public PVEBattleResultScRsp clearEventId() {
      bitField0_ &= ~0x00000004;
      eventId = 0;
      return this;
    }

    /**
     * <code>optional uint32 event_id = 12;</code>
     * @return the eventId
     */
    public int getEventId() {
      return eventId;
    }

    /**
     * <code>optional uint32 event_id = 12;</code>
     * @param value the eventId to set
     * @return this
     */
    public PVEBattleResultScRsp setEventId(final int value) {
      bitField0_ |= 0x00000004;
      eventId = value;
      return this;
    }

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

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

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

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

    /**
     * <code>optional uint32 retcode = 14;</code>
     * @return whether the retcode field is set
     */
    public boolean hasRetcode() {
      return (bitField0_ & 0x00000010) != 0;
    }

    /**
     * <code>optional uint32 retcode = 14;</code>
     * @return this
     */
    public PVEBattleResultScRsp clearRetcode() {
      bitField0_ &= ~0x00000010;
      retcode = 0;
      return this;
    }

    /**
     * <code>optional uint32 retcode = 14;</code>
     * @return the retcode
     */
    public int getRetcode() {
      return retcode;
    }

    /**
     * <code>optional uint32 retcode = 14;</code>
     * @param value the retcode to set
     * @return this
     */
    public PVEBattleResultScRsp setRetcode(final int value) {
      bitField0_ |= 0x00000010;
      retcode = value;
      return this;
    }

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

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

    /**
     * <code>optional .BattleEndStatus end_status = 4;</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 PVEBattleResultScRsp#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 PVEBattleResultScRsp#getEndStatus()} to return null
     *
     * @param value the numeric wire value to set
     * @return this
     */
    public PVEBattleResultScRsp setEndStatusValue(final int value) {
      bitField0_ |= 0x00000020;
      endStatus = value;
      return this;
    }

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

    /**
     * <code>optional bool check_identical = 8;</code>
     * @return whether the checkIdentical field is set
     */
    public boolean hasCheckIdentical() {
      return (bitField0_ & 0x00000040) != 0;
    }

    /**
     * <code>optional bool check_identical = 8;</code>
     * @return this
     */
    public PVEBattleResultScRsp clearCheckIdentical() {
      bitField0_ &= ~0x00000040;
      checkIdentical = false;
      return this;
    }

    /**
     * <code>optional bool check_identical = 8;</code>
     * @return the checkIdentical
     */
    public boolean getCheckIdentical() {
      return checkIdentical;
    }

    /**
     * <code>optional bool check_identical = 8;</code>
     * @param value the checkIdentical to set
     * @return this
     */
    public PVEBattleResultScRsp setCheckIdentical(final boolean value) {
      bitField0_ |= 0x00000040;
      checkIdentical = value;
      return this;
    }

    /**
     * <code>optional .ItemList drop_data = 5;</code>
     * @return whether the dropData field is set
     */
    public boolean hasDropData() {
      return (bitField0_ & 0x00000080) != 0;
    }

    /**
     * <code>optional .ItemList drop_data = 5;</code>
     * @return this
     */
    public PVEBattleResultScRsp clearDropData() {
      bitField0_ &= ~0x00000080;
      dropData.clear();
      return this;
    }

    /**
     * <code>optional .ItemList drop_data = 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 #getMutableDropData()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public ItemListOuterClass.ItemList getDropData() {
      return dropData;
    }

    /**
     * <code>optional .ItemList drop_data = 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 ItemListOuterClass.ItemList getMutableDropData() {
      bitField0_ |= 0x00000080;
      return dropData;
    }

    /**
     * <code>optional .ItemList drop_data = 5;</code>
     * @param value the dropData to set
     * @return this
     */
    public PVEBattleResultScRsp setDropData(final ItemListOuterClass.ItemList value) {
      bitField0_ |= 0x00000080;
      dropData.copyFrom(value);
      return this;
    }

    /**
     * <code>optional .ItemList extra_drop_data = 6;</code>
     * @return whether the extraDropData field is set
     */
    public boolean hasExtraDropData() {
      return (bitField0_ & 0x00000100) != 0;
    }

    /**
     * <code>optional .ItemList extra_drop_data = 6;</code>
     * @return this
     */
    public PVEBattleResultScRsp clearExtraDropData() {
      bitField0_ &= ~0x00000100;
      extraDropData.clear();
      return this;
    }

    /**
     * <code>optional .ItemList extra_drop_data = 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 #getMutableExtraDropData()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public ItemListOuterClass.ItemList getExtraDropData() {
      return extraDropData;
    }

    /**
     * <code>optional .ItemList extra_drop_data = 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 ItemListOuterClass.ItemList getMutableExtraDropData() {
      bitField0_ |= 0x00000100;
      return extraDropData;
    }

    /**
     * <code>optional .ItemList extra_drop_data = 6;</code>
     * @param value the extraDropData to set
     * @return this
     */
    public PVEBattleResultScRsp setExtraDropData(final ItemListOuterClass.ItemList value) {
      bitField0_ |= 0x00000100;
      extraDropData.copyFrom(value);
      return this;
    }

    /**
     * <code>optional .ItemList unk_item_list_2 = 7;</code>
     * @return whether the unkItemList2 field is set
     */
    public boolean hasUnkItemList2() {
      return (bitField0_ & 0x00000200) != 0;
    }

    /**
     * <code>optional .ItemList unk_item_list_2 = 7;</code>
     * @return this
     */
    public PVEBattleResultScRsp clearUnkItemList2() {
      bitField0_ &= ~0x00000200;
      unkItemList2.clear();
      return this;
    }

    /**
     * <code>optional .ItemList unk_item_list_2 = 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 #getMutableUnkItemList2()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public ItemListOuterClass.ItemList getUnkItemList2() {
      return unkItemList2;
    }

    /**
     * <code>optional .ItemList unk_item_list_2 = 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 ItemListOuterClass.ItemList getMutableUnkItemList2() {
      bitField0_ |= 0x00000200;
      return unkItemList2;
    }

    /**
     * <code>optional .ItemList unk_item_list_2 = 7;</code>
     * @param value the unkItemList2 to set
     * @return this
     */
    public PVEBattleResultScRsp setUnkItemList2(final ItemListOuterClass.ItemList value) {
      bitField0_ |= 0x00000200;
      unkItemList2.copyFrom(value);
      return this;
    }

    /**
     * <code>optional .ItemList unk_item_list_3 = 460;</code>
     * @return whether the unkItemList3 field is set
     */
    public boolean hasUnkItemList3() {
      return (bitField0_ & 0x00000400) != 0;
    }

    /**
     * <code>optional .ItemList unk_item_list_3 = 460;</code>
     * @return this
     */
    public PVEBattleResultScRsp clearUnkItemList3() {
      bitField0_ &= ~0x00000400;
      unkItemList3.clear();
      return this;
    }

    /**
     * <code>optional .ItemList unk_item_list_3 = 460;</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 #getMutableUnkItemList3()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public ItemListOuterClass.ItemList getUnkItemList3() {
      return unkItemList3;
    }

    /**
     * <code>optional .ItemList unk_item_list_3 = 460;</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 ItemListOuterClass.ItemList getMutableUnkItemList3() {
      bitField0_ |= 0x00000400;
      return unkItemList3;
    }

    /**
     * <code>optional .ItemList unk_item_list_3 = 460;</code>
     * @param value the unkItemList3 to set
     * @return this
     */
    public PVEBattleResultScRsp setUnkItemList3(final ItemListOuterClass.ItemList value) {
      bitField0_ |= 0x00000400;
      unkItemList3.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string res_version = 2;</code>
     * @return whether the resVersion field is set
     */
    public boolean hasResVersion() {
      return (bitField0_ & 0x00000800) != 0;
    }

    /**
     * <code>optional string res_version = 2;</code>
     * @return this
     */
    public PVEBattleResultScRsp clearResVersion() {
      bitField0_ &= ~0x00000800;
      resVersion.clear();
      return this;
    }

    /**
     * <code>optional string res_version = 2;</code>
     * @return the resVersion
     */
    public String getResVersion() {
      return resVersion.getString();
    }

    /**
     * <code>optional string res_version = 2;</code>
     * @return internal {@code Utf8String} representation of resVersion for reading
     */
    public Utf8String getResVersionBytes() {
      return this.resVersion;
    }

    /**
     * <code>optional string res_version = 2;</code>
     * @return internal {@code Utf8String} representation of resVersion for modifications
     */
    public Utf8String getMutableResVersionBytes() {
      bitField0_ |= 0x00000800;
      return this.resVersion;
    }

    /**
     * <code>optional string res_version = 2;</code>
     * @param value the resVersion to set
     * @return this
     */
    public PVEBattleResultScRsp setResVersion(final CharSequence value) {
      bitField0_ |= 0x00000800;
      resVersion.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string res_version = 2;</code>
     * @param value the resVersion to set
     * @return this
     */
    public PVEBattleResultScRsp setResVersion(final Utf8String value) {
      bitField0_ |= 0x00000800;
      resVersion.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string bin_version = 15;</code>
     * @return whether the binVersion field is set
     */
    public boolean hasBinVersion() {
      return (bitField0_ & 0x00001000) != 0;
    }

    /**
     * <code>optional string bin_version = 15;</code>
     * @return this
     */
    public PVEBattleResultScRsp clearBinVersion() {
      bitField0_ &= ~0x00001000;
      binVersion.clear();
      return this;
    }

    /**
     * <code>optional string bin_version = 15;</code>
     * @return the binVersion
     */
    public String getBinVersion() {
      return binVersion.getString();
    }

    /**
     * <code>optional string bin_version = 15;</code>
     * @return internal {@code Utf8String} representation of binVersion for reading
     */
    public Utf8String getBinVersionBytes() {
      return this.binVersion;
    }

    /**
     * <code>optional string bin_version = 15;</code>
     * @return internal {@code Utf8String} representation of binVersion for modifications
     */
    public Utf8String getMutableBinVersionBytes() {
      bitField0_ |= 0x00001000;
      return this.binVersion;
    }

    /**
     * <code>optional string bin_version = 15;</code>
     * @param value the binVersion to set
     * @return this
     */
    public PVEBattleResultScRsp setBinVersion(final CharSequence value) {
      bitField0_ |= 0x00001000;
      binVersion.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string bin_version = 15;</code>
     * @param value the binVersion to set
     * @return this
     */
    public PVEBattleResultScRsp setBinVersion(final Utf8String value) {
      bitField0_ |= 0x00001000;
      binVersion.copyFrom(value);
      return this;
    }

    /**
     * <code>repeated .BattleAvatar battle_avatar_list = 9;</code>
     * @return whether the battleAvatarList field is set
     */
    public boolean hasBattleAvatarList() {
      return (bitField0_ & 0x00002000) != 0;
    }

    /**
     * <code>repeated .BattleAvatar battle_avatar_list = 9;</code>
     * @return this
     */
    public PVEBattleResultScRsp clearBattleAvatarList() {
      bitField0_ &= ~0x00002000;
      battleAvatarList.clear();
      return this;
    }

    /**
     * <code>repeated .BattleAvatar battle_avatar_list = 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 #getMutableBattleAvatarList()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RepeatedMessage<BattleAvatarOuterClass.BattleAvatar> getBattleAvatarList() {
      return battleAvatarList;
    }

    /**
     * <code>repeated .BattleAvatar battle_avatar_list = 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 RepeatedMessage<BattleAvatarOuterClass.BattleAvatar> getMutableBattleAvatarList() {
      bitField0_ |= 0x00002000;
      return battleAvatarList;
    }

    /**
     * <code>repeated .BattleAvatar battle_avatar_list = 9;</code>
     * @param value the battleAvatarList to add
     * @return this
     */
    public PVEBattleResultScRsp addBattleAvatarList(
        final BattleAvatarOuterClass.BattleAvatar value) {
      bitField0_ |= 0x00002000;
      battleAvatarList.add(value);
      return this;
    }

    /**
     * <code>repeated .BattleAvatar battle_avatar_list = 9;</code>
     * @param values the battleAvatarList to add
     * @return this
     */
    public PVEBattleResultScRsp addAllBattleAvatarList(
        final BattleAvatarOuterClass.BattleAvatar... values) {
      bitField0_ |= 0x00002000;
      battleAvatarList.addAll(values);
      return this;
    }

    @Override
    public PVEBattleResultScRsp copyFrom(final PVEBattleResultScRsp other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        stageId = other.stageId;
        mismatchTurnCount = other.mismatchTurnCount;
        eventId = other.eventId;
        battleId = other.battleId;
        retcode = other.retcode;
        endStatus = other.endStatus;
        checkIdentical = other.checkIdentical;
        dropData.copyFrom(other.dropData);
        extraDropData.copyFrom(other.extraDropData);
        unkItemList2.copyFrom(other.unkItemList2);
        unkItemList3.copyFrom(other.unkItemList3);
        resVersion.copyFrom(other.resVersion);
        binVersion.copyFrom(other.binVersion);
        battleAvatarList.copyFrom(other.battleAvatarList);
      }
      return this;
    }

    @Override
    public PVEBattleResultScRsp mergeFrom(final PVEBattleResultScRsp other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasStageId()) {
        setStageId(other.stageId);
      }
      if (other.hasMismatchTurnCount()) {
        setMismatchTurnCount(other.mismatchTurnCount);
      }
      if (other.hasEventId()) {
        setEventId(other.eventId);
      }
      if (other.hasBattleId()) {
        setBattleId(other.battleId);
      }
      if (other.hasRetcode()) {
        setRetcode(other.retcode);
      }
      if (other.hasEndStatus()) {
        setEndStatusValue(other.endStatus);
      }
      if (other.hasCheckIdentical()) {
        setCheckIdentical(other.checkIdentical);
      }
      if (other.hasDropData()) {
        getMutableDropData().mergeFrom(other.dropData);
      }
      if (other.hasExtraDropData()) {
        getMutableExtraDropData().mergeFrom(other.extraDropData);
      }
      if (other.hasUnkItemList2()) {
        getMutableUnkItemList2().mergeFrom(other.unkItemList2);
      }
      if (other.hasUnkItemList3()) {
        getMutableUnkItemList3().mergeFrom(other.unkItemList3);
      }
      if (other.hasResVersion()) {
        getMutableResVersionBytes().copyFrom(other.resVersion);
      }
      if (other.hasBinVersion()) {
        getMutableBinVersionBytes().copyFrom(other.binVersion);
      }
      if (other.hasBattleAvatarList()) {
        getMutableBattleAvatarList().addAll(other.battleAvatarList);
      }
      return this;
    }

    @Override
    public PVEBattleResultScRsp clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      stageId = 0;
      mismatchTurnCount = 0;
      eventId = 0;
      battleId = 0;
      retcode = 0;
      endStatus = 0;
      checkIdentical = false;
      dropData.clear();
      extraDropData.clear();
      unkItemList2.clear();
      unkItemList3.clear();
      resVersion.clear();
      binVersion.clear();
      battleAvatarList.clear();
      return this;
    }

    @Override
    public PVEBattleResultScRsp clearQuick() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      dropData.clearQuick();
      extraDropData.clearQuick();
      unkItemList2.clearQuick();
      unkItemList3.clearQuick();
      resVersion.clear();
      binVersion.clear();
      battleAvatarList.clearQuick();
      return this;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof PVEBattleResultScRsp)) {
        return false;
      }
      PVEBattleResultScRsp other = (PVEBattleResultScRsp) o;
      return bitField0_ == other.bitField0_
        && (!hasStageId() || stageId == other.stageId)
        && (!hasMismatchTurnCount() || mismatchTurnCount == other.mismatchTurnCount)
        && (!hasEventId() || eventId == other.eventId)
        && (!hasBattleId() || battleId == other.battleId)
        && (!hasRetcode() || retcode == other.retcode)
        && (!hasEndStatus() || endStatus == other.endStatus)
        && (!hasCheckIdentical() || checkIdentical == other.checkIdentical)
        && (!hasDropData() || dropData.equals(other.dropData))
        && (!hasExtraDropData() || extraDropData.equals(other.extraDropData))
        && (!hasUnkItemList2() || unkItemList2.equals(other.unkItemList2))
        && (!hasUnkItemList3() || unkItemList3.equals(other.unkItemList3))
        && (!hasResVersion() || resVersion.equals(other.resVersion))
        && (!hasBinVersion() || binVersion.equals(other.binVersion))
        && (!hasBattleAvatarList() || battleAvatarList.equals(other.battleAvatarList));
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawByte((byte) 24);
        output.writeUInt32NoTag(stageId);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRawByte((byte) 80);
        output.writeUInt32NoTag(mismatchTurnCount);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRawByte((byte) 96);
        output.writeUInt32NoTag(eventId);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeRawByte((byte) 104);
        output.writeUInt32NoTag(battleId);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeRawByte((byte) 112);
        output.writeUInt32NoTag(retcode);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        output.writeRawByte((byte) 32);
        output.writeEnumNoTag(endStatus);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        output.writeRawByte((byte) 64);
        output.writeBoolNoTag(checkIdentical);
      }
      if ((bitField0_ & 0x00000080) != 0) {
        output.writeRawByte((byte) 42);
        output.writeMessageNoTag(dropData);
      }
      if ((bitField0_ & 0x00000100) != 0) {
        output.writeRawByte((byte) 50);
        output.writeMessageNoTag(extraDropData);
      }
      if ((bitField0_ & 0x00000200) != 0) {
        output.writeRawByte((byte) 58);
        output.writeMessageNoTag(unkItemList2);
      }
      if ((bitField0_ & 0x00000400) != 0) {
        output.writeRawLittleEndian16((short) 7394);
        output.writeMessageNoTag(unkItemList3);
      }
      if ((bitField0_ & 0x00000800) != 0) {
        output.writeRawByte((byte) 18);
        output.writeStringNoTag(resVersion);
      }
      if ((bitField0_ & 0x00001000) != 0) {
        output.writeRawByte((byte) 122);
        output.writeStringNoTag(binVersion);
      }
      if ((bitField0_ & 0x00002000) != 0) {
        for (int i = 0; i < battleAvatarList.length(); i++) {
          output.writeRawByte((byte) 74);
          output.writeMessageNoTag(battleAvatarList.get(i));
        }
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(stageId);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(mismatchTurnCount);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(eventId);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(battleId);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        size += 1 + ProtoSink.computeEnumSizeNoTag(endStatus);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        size += 2;
      }
      if ((bitField0_ & 0x00000080) != 0) {
        size += 1 + ProtoSink.computeMessageSizeNoTag(dropData);
      }
      if ((bitField0_ & 0x00000100) != 0) {
        size += 1 + ProtoSink.computeMessageSizeNoTag(extraDropData);
      }
      if ((bitField0_ & 0x00000200) != 0) {
        size += 1 + ProtoSink.computeMessageSizeNoTag(unkItemList2);
      }
      if ((bitField0_ & 0x00000400) != 0) {
        size += 2 + ProtoSink.computeMessageSizeNoTag(unkItemList3);
      }
      if ((bitField0_ & 0x00000800) != 0) {
        size += 1 + ProtoSink.computeStringSizeNoTag(resVersion);
      }
      if ((bitField0_ & 0x00001000) != 0) {
        size += 1 + ProtoSink.computeStringSizeNoTag(binVersion);
      }
      if ((bitField0_ & 0x00002000) != 0) {
        size += (1 * battleAvatarList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(battleAvatarList);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public PVEBattleResultScRsp mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 24: {
            // stageId
            stageId = input.readUInt32();
            bitField0_ |= 0x00000001;
            tag = input.readTag();
            if (tag != 80) {
              break;
            }
          }
          case 80: {
            // mismatchTurnCount
            mismatchTurnCount = input.readUInt32();
            bitField0_ |= 0x00000002;
            tag = input.readTag();
            if (tag != 96) {
              break;
            }
          }
          case 96: {
            // eventId
            eventId = input.readUInt32();
            bitField0_ |= 0x00000004;
            tag = input.readTag();
            if (tag != 104) {
              break;
            }
          }
          case 104: {
            // battleId
            battleId = input.readUInt32();
            bitField0_ |= 0x00000008;
            tag = input.readTag();
            if (tag != 112) {
              break;
            }
          }
          case 112: {
            // retcode
            retcode = input.readUInt32();
            bitField0_ |= 0x00000010;
            tag = input.readTag();
            if (tag != 32) {
              break;
            }
          }
          case 32: {
            // endStatus
            final int value = input.readInt32();
            if (BattleEndStatusOuterClass.BattleEndStatus.forNumber(value) != null) {
              endStatus = value;
              bitField0_ |= 0x00000020;
            }
            tag = input.readTag();
            if (tag != 64) {
              break;
            }
          }
          case 64: {
            // checkIdentical
            checkIdentical = input.readBool();
            bitField0_ |= 0x00000040;
            tag = input.readTag();
            if (tag != 42) {
              break;
            }
          }
          case 42: {
            // dropData
            input.readMessage(dropData);
            bitField0_ |= 0x00000080;
            tag = input.readTag();
            if (tag != 50) {
              break;
            }
          }
          case 50: {
            // extraDropData
            input.readMessage(extraDropData);
            bitField0_ |= 0x00000100;
            tag = input.readTag();
            if (tag != 58) {
              break;
            }
          }
          case 58: {
            // unkItemList2
            input.readMessage(unkItemList2);
            bitField0_ |= 0x00000200;
            tag = input.readTag();
            if (tag != 3682) {
              break;
            }
          }
          case 3682: {
            // unkItemList3
            input.readMessage(unkItemList3);
            bitField0_ |= 0x00000400;
            tag = input.readTag();
            if (tag != 18) {
              break;
            }
          }
          case 18: {
            // resVersion
            input.readString(resVersion);
            bitField0_ |= 0x00000800;
            tag = input.readTag();
            if (tag != 122) {
              break;
            }
          }
          case 122: {
            // binVersion
            input.readString(binVersion);
            bitField0_ |= 0x00001000;
            tag = input.readTag();
            if (tag != 74) {
              break;
            }
          }
          case 74: {
            // battleAvatarList
            tag = input.readRepeatedMessage(battleAvatarList, tag);
            bitField0_ |= 0x00002000;
            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.stageId, stageId);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeUInt32(FieldNames.mismatchTurnCount, mismatchTurnCount);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeUInt32(FieldNames.eventId, eventId);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeUInt32(FieldNames.battleId, battleId);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeUInt32(FieldNames.retcode, retcode);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        output.writeEnum(FieldNames.endStatus, endStatus, BattleEndStatusOuterClass.BattleEndStatus.converter());
      }
      if ((bitField0_ & 0x00000040) != 0) {
        output.writeBool(FieldNames.checkIdentical, checkIdentical);
      }
      if ((bitField0_ & 0x00000080) != 0) {
        output.writeMessage(FieldNames.dropData, dropData);
      }
      if ((bitField0_ & 0x00000100) != 0) {
        output.writeMessage(FieldNames.extraDropData, extraDropData);
      }
      if ((bitField0_ & 0x00000200) != 0) {
        output.writeMessage(FieldNames.unkItemList2, unkItemList2);
      }
      if ((bitField0_ & 0x00000400) != 0) {
        output.writeMessage(FieldNames.unkItemList3, unkItemList3);
      }
      if ((bitField0_ & 0x00000800) != 0) {
        output.writeString(FieldNames.resVersion, resVersion);
      }
      if ((bitField0_ & 0x00001000) != 0) {
        output.writeString(FieldNames.binVersion, binVersion);
      }
      if ((bitField0_ & 0x00002000) != 0) {
        output.writeRepeatedMessage(FieldNames.battleAvatarList, battleAvatarList);
      }
      output.endObject();
    }

    @Override
    public PVEBattleResultScRsp mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case -1897528135:
          case 1306191356: {
            if (input.isAtField(FieldNames.stageId)) {
              if (!input.trySkipNullValue()) {
                stageId = input.readUInt32();
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -2096079772:
          case -1800906274: {
            if (input.isAtField(FieldNames.mismatchTurnCount)) {
              if (!input.trySkipNullValue()) {
                mismatchTurnCount = input.readUInt32();
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1376502443:
          case 278118624: {
            if (input.isAtField(FieldNames.eventId)) {
              if (!input.trySkipNullValue()) {
                eventId = 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 1097936398: {
            if (input.isAtField(FieldNames.retcode)) {
              if (!input.trySkipNullValue()) {
                retcode = input.readUInt32();
                bitField0_ |= 0x00000010;
              }
            } 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_ |= 0x00000020;
                } else {
                  input.skipUnknownEnumValue();
                }
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 1926285453:
          case 2102762046: {
            if (input.isAtField(FieldNames.checkIdentical)) {
              if (!input.trySkipNullValue()) {
                checkIdentical = input.readBool();
                bitField0_ |= 0x00000040;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -433028295:
          case -513968390: {
            if (input.isAtField(FieldNames.dropData)) {
              if (!input.trySkipNullValue()) {
                input.readMessage(dropData);
                bitField0_ |= 0x00000080;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 222653289:
          case -951570037: {
            if (input.isAtField(FieldNames.extraDropData)) {
              if (!input.trySkipNullValue()) {
                input.readMessage(extraDropData);
                bitField0_ |= 0x00000100;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1880508625:
          case -2030974032: {
            if (input.isAtField(FieldNames.unkItemList2)) {
              if (!input.trySkipNullValue()) {
                input.readMessage(unkItemList2);
                bitField0_ |= 0x00000200;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1880508624:
          case -2030974031: {
            if (input.isAtField(FieldNames.unkItemList3)) {
              if (!input.trySkipNullValue()) {
                input.readMessage(unkItemList3);
                bitField0_ |= 0x00000400;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 1778976792:
          case -351019975: {
            if (input.isAtField(FieldNames.resVersion)) {
              if (!input.trySkipNullValue()) {
                input.readString(resVersion);
                bitField0_ |= 0x00000800;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 1864225233:
          case -2003285600: {
            if (input.isAtField(FieldNames.binVersion)) {
              if (!input.trySkipNullValue()) {
                input.readString(binVersion);
                bitField0_ |= 0x00001000;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 768292975:
          case 328463037: {
            if (input.isAtField(FieldNames.battleAvatarList)) {
              if (!input.trySkipNullValue()) {
                input.readRepeatedMessage(battleAvatarList);
                bitField0_ |= 0x00002000;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    private enum PVEBattleResultScRspFactory implements MessageFactory<PVEBattleResultScRsp> {
      INSTANCE;

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

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

      static final FieldName mismatchTurnCount = FieldName.forField("mismatchTurnCount", "mismatch_turn_count");

      static final FieldName eventId = FieldName.forField("eventId", "event_id");

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

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

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

      static final FieldName checkIdentical = FieldName.forField("checkIdentical", "check_identical");

      static final FieldName dropData = FieldName.forField("dropData", "drop_data");

      static final FieldName extraDropData = FieldName.forField("extraDropData", "extra_drop_data");

      static final FieldName unkItemList2 = FieldName.forField("unkItemList2", "unk_item_list_2");

      static final FieldName unkItemList3 = FieldName.forField("unkItemList3", "unk_item_list_3");

      static final FieldName resVersion = FieldName.forField("resVersion", "res_version");

      static final FieldName binVersion = FieldName.forField("binVersion", "bin_version");

      static final FieldName battleAvatarList = FieldName.forField("battleAvatarList", "battle_avatar_list");
    }
  }
}
