// 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 event_id = 4;</code>
     */
    private int eventId;

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

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

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

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

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

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

    /**
     * <code>optional .ItemList unk1 = 3;</code>
     */
    private final ItemListOuterClass.ItemList unk1 = ItemListOuterClass.ItemList.newInstance();

    /**
     * <code>optional .ItemList unk2 = 11;</code>
     */
    private final ItemListOuterClass.ItemList unk2 = ItemListOuterClass.ItemList.newInstance();

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

    /**
     * <code>optional .ItemList unk3 = 355;</code>
     */
    private final ItemListOuterClass.ItemList unk3 = ItemListOuterClass.ItemList.newInstance();

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

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

    /**
     * <code>repeated .BattleAvatar battle_avatar_list = 6;</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 event_id = 4;</code>
     * @return whether the eventId field is set
     */
    public boolean hasEventId() {
      return (bitField0_ & 0x00000001) != 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * <code>optional .BattleEndStatus end_status = 13;</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 = 13;</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 = 15;</code>
     * @return whether the checkIdentical field is set
     */
    public boolean hasCheckIdentical() {
      return (bitField0_ & 0x00000040) != 0;
    }

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

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

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

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

    /**
     * <code>optional .ItemList unk1 = 3;</code>
     * @return this
     */
    public PVEBattleResultScRsp clearUnk1() {
      bitField0_ &= ~0x00000080;
      unk1.clear();
      return this;
    }

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

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

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

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

    /**
     * <code>optional .ItemList unk2 = 11;</code>
     * @return this
     */
    public PVEBattleResultScRsp clearUnk2() {
      bitField0_ &= ~0x00000100;
      unk2.clear();
      return this;
    }

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

    /**
     * <code>optional .ItemList unk2 = 11;</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 getMutableUnk2() {
      bitField0_ |= 0x00000100;
      return unk2;
    }

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

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

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

    /**
     * <code>optional .ItemList drop_data = 12;</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 = 12;</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_ |= 0x00000200;
      return dropData;
    }

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

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

    /**
     * <code>optional .ItemList unk3 = 355;</code>
     * @return this
     */
    public PVEBattleResultScRsp clearUnk3() {
      bitField0_ &= ~0x00000400;
      unk3.clear();
      return this;
    }

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

    /**
     * <code>optional .ItemList unk3 = 355;</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 getMutableUnk3() {
      bitField0_ |= 0x00000400;
      return unk3;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * <code>repeated .BattleAvatar battle_avatar_list = 6;</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 = 6;</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_;
        eventId = other.eventId;
        retcode = other.retcode;
        battleId = other.battleId;
        stageId = other.stageId;
        mismatchTurnCount = other.mismatchTurnCount;
        endStatus = other.endStatus;
        checkIdentical = other.checkIdentical;
        unk1.copyFrom(other.unk1);
        unk2.copyFrom(other.unk2);
        dropData.copyFrom(other.dropData);
        unk3.copyFrom(other.unk3);
        binVersion.copyFrom(other.binVersion);
        resVersion.copyFrom(other.resVersion);
        battleAvatarList.copyFrom(other.battleAvatarList);
      }
      return this;
    }

    @Override
    public PVEBattleResultScRsp mergeFrom(final PVEBattleResultScRsp other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasEventId()) {
        setEventId(other.eventId);
      }
      if (other.hasRetcode()) {
        setRetcode(other.retcode);
      }
      if (other.hasBattleId()) {
        setBattleId(other.battleId);
      }
      if (other.hasStageId()) {
        setStageId(other.stageId);
      }
      if (other.hasMismatchTurnCount()) {
        setMismatchTurnCount(other.mismatchTurnCount);
      }
      if (other.hasEndStatus()) {
        setEndStatusValue(other.endStatus);
      }
      if (other.hasCheckIdentical()) {
        setCheckIdentical(other.checkIdentical);
      }
      if (other.hasUnk1()) {
        getMutableUnk1().mergeFrom(other.unk1);
      }
      if (other.hasUnk2()) {
        getMutableUnk2().mergeFrom(other.unk2);
      }
      if (other.hasDropData()) {
        getMutableDropData().mergeFrom(other.dropData);
      }
      if (other.hasUnk3()) {
        getMutableUnk3().mergeFrom(other.unk3);
      }
      if (other.hasBinVersion()) {
        getMutableBinVersionBytes().copyFrom(other.binVersion);
      }
      if (other.hasResVersion()) {
        getMutableResVersionBytes().copyFrom(other.resVersion);
      }
      if (other.hasBattleAvatarList()) {
        getMutableBattleAvatarList().addAll(other.battleAvatarList);
      }
      return this;
    }

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

    @Override
    public PVEBattleResultScRsp clearQuick() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      unk1.clearQuick();
      unk2.clearQuick();
      dropData.clearQuick();
      unk3.clearQuick();
      binVersion.clear();
      resVersion.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_
        && (!hasEventId() || eventId == other.eventId)
        && (!hasRetcode() || retcode == other.retcode)
        && (!hasBattleId() || battleId == other.battleId)
        && (!hasStageId() || stageId == other.stageId)
        && (!hasMismatchTurnCount() || mismatchTurnCount == other.mismatchTurnCount)
        && (!hasEndStatus() || endStatus == other.endStatus)
        && (!hasCheckIdentical() || checkIdentical == other.checkIdentical)
        && (!hasUnk1() || unk1.equals(other.unk1))
        && (!hasUnk2() || unk2.equals(other.unk2))
        && (!hasDropData() || dropData.equals(other.dropData))
        && (!hasUnk3() || unk3.equals(other.unk3))
        && (!hasBinVersion() || binVersion.equals(other.binVersion))
        && (!hasResVersion() || resVersion.equals(other.resVersion))
        && (!hasBattleAvatarList() || battleAvatarList.equals(other.battleAvatarList));
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawByte((byte) 32);
        output.writeUInt32NoTag(eventId);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRawByte((byte) 40);
        output.writeUInt32NoTag(retcode);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRawByte((byte) 72);
        output.writeUInt32NoTag(battleId);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeRawByte((byte) 80);
        output.writeUInt32NoTag(stageId);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeRawByte((byte) 112);
        output.writeUInt32NoTag(mismatchTurnCount);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        output.writeRawByte((byte) 104);
        output.writeEnumNoTag(endStatus);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        output.writeRawByte((byte) 120);
        output.writeBoolNoTag(checkIdentical);
      }
      if ((bitField0_ & 0x00000080) != 0) {
        output.writeRawByte((byte) 26);
        output.writeMessageNoTag(unk1);
      }
      if ((bitField0_ & 0x00000100) != 0) {
        output.writeRawByte((byte) 90);
        output.writeMessageNoTag(unk2);
      }
      if ((bitField0_ & 0x00000200) != 0) {
        output.writeRawByte((byte) 98);
        output.writeMessageNoTag(dropData);
      }
      if ((bitField0_ & 0x00000400) != 0) {
        output.writeRawLittleEndian16((short) 5786);
        output.writeMessageNoTag(unk3);
      }
      if ((bitField0_ & 0x00000800) != 0) {
        output.writeRawByte((byte) 58);
        output.writeStringNoTag(binVersion);
      }
      if ((bitField0_ & 0x00001000) != 0) {
        output.writeRawByte((byte) 66);
        output.writeStringNoTag(resVersion);
      }
      if ((bitField0_ & 0x00002000) != 0) {
        for (int i = 0; i < battleAvatarList.length(); i++) {
          output.writeRawByte((byte) 50);
          output.writeMessageNoTag(battleAvatarList.get(i));
        }
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(eventId);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(battleId);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(stageId);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(mismatchTurnCount);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        size += 1 + ProtoSink.computeEnumSizeNoTag(endStatus);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        size += 2;
      }
      if ((bitField0_ & 0x00000080) != 0) {
        size += 1 + ProtoSink.computeMessageSizeNoTag(unk1);
      }
      if ((bitField0_ & 0x00000100) != 0) {
        size += 1 + ProtoSink.computeMessageSizeNoTag(unk2);
      }
      if ((bitField0_ & 0x00000200) != 0) {
        size += 1 + ProtoSink.computeMessageSizeNoTag(dropData);
      }
      if ((bitField0_ & 0x00000400) != 0) {
        size += 2 + ProtoSink.computeMessageSizeNoTag(unk3);
      }
      if ((bitField0_ & 0x00000800) != 0) {
        size += 1 + ProtoSink.computeStringSizeNoTag(binVersion);
      }
      if ((bitField0_ & 0x00001000) != 0) {
        size += 1 + ProtoSink.computeStringSizeNoTag(resVersion);
      }
      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 32: {
            // eventId
            eventId = input.readUInt32();
            bitField0_ |= 0x00000001;
            tag = input.readTag();
            if (tag != 40) {
              break;
            }
          }
          case 40: {
            // retcode
            retcode = input.readUInt32();
            bitField0_ |= 0x00000002;
            tag = input.readTag();
            if (tag != 72) {
              break;
            }
          }
          case 72: {
            // battleId
            battleId = input.readUInt32();
            bitField0_ |= 0x00000004;
            tag = input.readTag();
            if (tag != 80) {
              break;
            }
          }
          case 80: {
            // stageId
            stageId = input.readUInt32();
            bitField0_ |= 0x00000008;
            tag = input.readTag();
            if (tag != 112) {
              break;
            }
          }
          case 112: {
            // mismatchTurnCount
            mismatchTurnCount = input.readUInt32();
            bitField0_ |= 0x00000010;
            tag = input.readTag();
            if (tag != 104) {
              break;
            }
          }
          case 104: {
            // endStatus
            final int value = input.readInt32();
            if (BattleEndStatusOuterClass.BattleEndStatus.forNumber(value) != null) {
              endStatus = value;
              bitField0_ |= 0x00000020;
            }
            tag = input.readTag();
            if (tag != 120) {
              break;
            }
          }
          case 120: {
            // checkIdentical
            checkIdentical = input.readBool();
            bitField0_ |= 0x00000040;
            tag = input.readTag();
            if (tag != 26) {
              break;
            }
          }
          case 26: {
            // unk1
            input.readMessage(unk1);
            bitField0_ |= 0x00000080;
            tag = input.readTag();
            if (tag != 90) {
              break;
            }
          }
          case 90: {
            // unk2
            input.readMessage(unk2);
            bitField0_ |= 0x00000100;
            tag = input.readTag();
            if (tag != 98) {
              break;
            }
          }
          case 98: {
            // dropData
            input.readMessage(dropData);
            bitField0_ |= 0x00000200;
            tag = input.readTag();
            if (tag != 2842) {
              break;
            }
          }
          case 2842: {
            // unk3
            input.readMessage(unk3);
            bitField0_ |= 0x00000400;
            tag = input.readTag();
            if (tag != 58) {
              break;
            }
          }
          case 58: {
            // binVersion
            input.readString(binVersion);
            bitField0_ |= 0x00000800;
            tag = input.readTag();
            if (tag != 66) {
              break;
            }
          }
          case 66: {
            // resVersion
            input.readString(resVersion);
            bitField0_ |= 0x00001000;
            tag = input.readTag();
            if (tag != 50) {
              break;
            }
          }
          case 50: {
            // 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.eventId, eventId);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeUInt32(FieldNames.retcode, retcode);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeUInt32(FieldNames.battleId, battleId);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeUInt32(FieldNames.stageId, stageId);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeUInt32(FieldNames.mismatchTurnCount, mismatchTurnCount);
      }
      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.unk1, unk1);
      }
      if ((bitField0_ & 0x00000100) != 0) {
        output.writeMessage(FieldNames.unk2, unk2);
      }
      if ((bitField0_ & 0x00000200) != 0) {
        output.writeMessage(FieldNames.dropData, dropData);
      }
      if ((bitField0_ & 0x00000400) != 0) {
        output.writeMessage(FieldNames.unk3, unk3);
      }
      if ((bitField0_ & 0x00000800) != 0) {
        output.writeString(FieldNames.binVersion, binVersion);
      }
      if ((bitField0_ & 0x00001000) != 0) {
        output.writeString(FieldNames.resVersion, resVersion);
      }
      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 -1376502443:
          case 278118624: {
            if (input.isAtField(FieldNames.eventId)) {
              if (!input.trySkipNullValue()) {
                eventId = input.readUInt32();
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 1097936398: {
            if (input.isAtField(FieldNames.retcode)) {
              if (!input.trySkipNullValue()) {
                retcode = input.readUInt32();
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1678308365:
          case -487930366: {
            if (input.isAtField(FieldNames.battleId)) {
              if (!input.trySkipNullValue()) {
                battleId = input.readUInt32();
                bitField0_ |= 0x00000004;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1897528135:
          case 1306191356: {
            if (input.isAtField(FieldNames.stageId)) {
              if (!input.trySkipNullValue()) {
                stageId = input.readUInt32();
                bitField0_ |= 0x00000008;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -2096079772:
          case -1800906274: {
            if (input.isAtField(FieldNames.mismatchTurnCount)) {
              if (!input.trySkipNullValue()) {
                mismatchTurnCount = 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 3594623: {
            if (input.isAtField(FieldNames.unk1)) {
              if (!input.trySkipNullValue()) {
                input.readMessage(unk1);
                bitField0_ |= 0x00000080;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 3594624: {
            if (input.isAtField(FieldNames.unk2)) {
              if (!input.trySkipNullValue()) {
                input.readMessage(unk2);
                bitField0_ |= 0x00000100;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -433028295:
          case -513968390: {
            if (input.isAtField(FieldNames.dropData)) {
              if (!input.trySkipNullValue()) {
                input.readMessage(dropData);
                bitField0_ |= 0x00000200;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 3594625: {
            if (input.isAtField(FieldNames.unk3)) {
              if (!input.trySkipNullValue()) {
                input.readMessage(unk3);
                bitField0_ |= 0x00000400;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 1864225233:
          case -2003285600: {
            if (input.isAtField(FieldNames.binVersion)) {
              if (!input.trySkipNullValue()) {
                input.readString(binVersion);
                bitField0_ |= 0x00000800;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 1778976792:
          case -351019975: {
            if (input.isAtField(FieldNames.resVersion)) {
              if (!input.trySkipNullValue()) {
                input.readString(resVersion);
                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 eventId = FieldName.forField("eventId", "event_id");

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

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

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

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

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

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

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

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

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

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

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

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

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