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

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

    /**
     * <code>optional uint32 record_id = 3;</code>
     */
    private int recordId;

    /**
     * <code>optional .BattleRecordType2.RecordType2 record = 7;</code>
     */
    private final RecordType2 record = RecordType2.newInstance();

    private BattleRecordType2() {
    }

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

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

    /**
     * <code>optional uint32 record_id = 3;</code>
     * @return this
     */
    public BattleRecordType2 clearRecordId() {
      bitField0_ &= ~0x00000001;
      recordId = 0;
      return this;
    }

    /**
     * <code>optional uint32 record_id = 3;</code>
     * @return the recordId
     */
    public int getRecordId() {
      return recordId;
    }

    /**
     * <code>optional uint32 record_id = 3;</code>
     * @param value the recordId to set
     * @return this
     */
    public BattleRecordType2 setRecordId(final int value) {
      bitField0_ |= 0x00000001;
      recordId = value;
      return this;
    }

    /**
     * <code>optional .BattleRecordType2.RecordType2 record = 7;</code>
     * @return whether the record field is set
     */
    public boolean hasRecord() {
      return (bitField0_ & 0x00000002) != 0;
    }

    /**
     * <code>optional .BattleRecordType2.RecordType2 record = 7;</code>
     * @return this
     */
    public BattleRecordType2 clearRecord() {
      bitField0_ &= ~0x00000002;
      record.clear();
      return this;
    }

    /**
     * <code>optional .BattleRecordType2.RecordType2 record = 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 #getMutableRecord()} if you want to modify it.
     *
     * @return internal storage object for reading
     */
    public RecordType2 getRecord() {
      return record;
    }

    /**
     * <code>optional .BattleRecordType2.RecordType2 record = 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 RecordType2 getMutableRecord() {
      bitField0_ |= 0x00000002;
      return record;
    }

    /**
     * <code>optional .BattleRecordType2.RecordType2 record = 7;</code>
     * @param value the record to set
     * @return this
     */
    public BattleRecordType2 setRecord(final RecordType2 value) {
      bitField0_ |= 0x00000002;
      record.copyFrom(value);
      return this;
    }

    @Override
    public BattleRecordType2 copyFrom(final BattleRecordType2 other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        recordId = other.recordId;
        record.copyFrom(other.record);
      }
      return this;
    }

    @Override
    public BattleRecordType2 mergeFrom(final BattleRecordType2 other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasRecordId()) {
        setRecordId(other.recordId);
      }
      if (other.hasRecord()) {
        getMutableRecord().mergeFrom(other.record);
      }
      return this;
    }

    @Override
    public BattleRecordType2 clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      recordId = 0;
      record.clear();
      return this;
    }

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

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof BattleRecordType2)) {
        return false;
      }
      BattleRecordType2 other = (BattleRecordType2) o;
      return bitField0_ == other.bitField0_
        && (!hasRecordId() || recordId == other.recordId)
        && (!hasRecord() || record.equals(other.record));
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawByte((byte) 24);
        output.writeUInt32NoTag(recordId);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRawByte((byte) 58);
        output.writeMessageNoTag(record);
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(recordId);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += 1 + ProtoSink.computeMessageSizeNoTag(record);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public BattleRecordType2 mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 24: {
            // recordId
            recordId = input.readUInt32();
            bitField0_ |= 0x00000001;
            tag = input.readTag();
            if (tag != 58) {
              break;
            }
          }
          case 58: {
            // record
            input.readMessage(record);
            bitField0_ |= 0x00000002;
            tag = input.readTag();
            if (tag != 0) {
              break;
            }
          }
          case 0: {
            return this;
          }
          default: {
            if (!input.skipField(tag)) {
              return this;
            }
            tag = input.readTag();
            break;
          }
        }
      }
    }

    @Override
    public void writeTo(final JsonSink output) throws IOException {
      output.beginObject();
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeUInt32(FieldNames.recordId, recordId);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeMessage(FieldNames.record, record);
      }
      output.endObject();
    }

    @Override
    public BattleRecordType2 mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case -799234740:
          case 993548233: {
            if (input.isAtField(FieldNames.recordId)) {
              if (!input.trySkipNullValue()) {
                recordId = input.readUInt32();
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -934908847: {
            if (input.isAtField(FieldNames.record)) {
              if (!input.trySkipNullValue()) {
                input.readMessage(record);
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

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

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

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

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

      /**
       * <code>optional .AvatarType avatar_type = 2;</code>
       */
      private int avatarType;

      private RecordDisplayAvatar() {
      }

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

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

      /**
       * <code>optional uint32 level = 1;</code>
       * @return this
       */
      public RecordDisplayAvatar clearLevel() {
        bitField0_ &= ~0x00000001;
        level = 0;
        return this;
      }

      /**
       * <code>optional uint32 level = 1;</code>
       * @return the level
       */
      public int getLevel() {
        return level;
      }

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

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

      /**
       * <code>optional uint32 slot = 3;</code>
       * @return this
       */
      public RecordDisplayAvatar clearSlot() {
        bitField0_ &= ~0x00000002;
        slot = 0;
        return this;
      }

      /**
       * <code>optional uint32 slot = 3;</code>
       * @return the slot
       */
      public int getSlot() {
        return slot;
      }

      /**
       * <code>optional uint32 slot = 3;</code>
       * @param value the slot to set
       * @return this
       */
      public RecordDisplayAvatar setSlot(final int value) {
        bitField0_ |= 0x00000002;
        slot = value;
        return this;
      }

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

      /**
       * <code>optional uint32 id = 5;</code>
       * @return this
       */
      public RecordDisplayAvatar clearId() {
        bitField0_ &= ~0x00000004;
        id = 0;
        return this;
      }

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

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

      /**
       * <code>optional .AvatarType avatar_type = 2;</code>
       * @return whether the avatarType field is set
       */
      public boolean hasAvatarType() {
        return (bitField0_ & 0x00000008) != 0;
      }

      /**
       * <code>optional .AvatarType avatar_type = 2;</code>
       * @return this
       */
      public RecordDisplayAvatar clearAvatarType() {
        bitField0_ &= ~0x00000008;
        avatarType = 0;
        return this;
      }

      /**
       * <code>optional .AvatarType avatar_type = 2;</code>
       * @return the avatarType
       */
      public AvatarTypeOuterClass.AvatarType getAvatarType() {
        return AvatarTypeOuterClass.AvatarType.forNumber(avatarType);
      }

      /**
       * Gets the value of the internal enum store. The result is
       * equivalent to {@link RecordDisplayAvatar#getAvatarType()}.getNumber().
       *
       * @return numeric wire representation
       */
      public int getAvatarTypeValue() {
        return avatarType;
      }

      /**
       * 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 AvatarTypeOuterClass.AvatarType}. Setting an invalid value
       * can cause {@link RecordDisplayAvatar#getAvatarType()} to return null
       *
       * @param value the numeric wire value to set
       * @return this
       */
      public RecordDisplayAvatar setAvatarTypeValue(final int value) {
        bitField0_ |= 0x00000008;
        avatarType = value;
        return this;
      }

      /**
       * <code>optional .AvatarType avatar_type = 2;</code>
       * @param value the avatarType to set
       * @return this
       */
      public RecordDisplayAvatar setAvatarType(final AvatarTypeOuterClass.AvatarType value) {
        bitField0_ |= 0x00000008;
        avatarType = value.getNumber();
        return this;
      }

      @Override
      public RecordDisplayAvatar copyFrom(final RecordDisplayAvatar other) {
        cachedSize = other.cachedSize;
        if ((bitField0_ | other.bitField0_) != 0) {
          bitField0_ = other.bitField0_;
          level = other.level;
          slot = other.slot;
          id = other.id;
          avatarType = other.avatarType;
        }
        return this;
      }

      @Override
      public RecordDisplayAvatar mergeFrom(final RecordDisplayAvatar other) {
        if (other.isEmpty()) {
          return this;
        }
        cachedSize = -1;
        if (other.hasLevel()) {
          setLevel(other.level);
        }
        if (other.hasSlot()) {
          setSlot(other.slot);
        }
        if (other.hasId()) {
          setId(other.id);
        }
        if (other.hasAvatarType()) {
          setAvatarTypeValue(other.avatarType);
        }
        return this;
      }

      @Override
      public RecordDisplayAvatar clear() {
        if (isEmpty()) {
          return this;
        }
        cachedSize = -1;
        bitField0_ = 0;
        level = 0;
        slot = 0;
        id = 0;
        avatarType = 0;
        return this;
      }

      @Override
      public RecordDisplayAvatar clearQuick() {
        if (isEmpty()) {
          return this;
        }
        cachedSize = -1;
        bitField0_ = 0;
        return this;
      }

      @Override
      public boolean equals(Object o) {
        if (o == this) {
          return true;
        }
        if (!(o instanceof RecordDisplayAvatar)) {
          return false;
        }
        RecordDisplayAvatar other = (RecordDisplayAvatar) o;
        return bitField0_ == other.bitField0_
          && (!hasLevel() || level == other.level)
          && (!hasSlot() || slot == other.slot)
          && (!hasId() || id == other.id)
          && (!hasAvatarType() || avatarType == other.avatarType);
      }

      @Override
      public void writeTo(final ProtoSink output) throws IOException {
        if ((bitField0_ & 0x00000001) != 0) {
          output.writeRawByte((byte) 8);
          output.writeUInt32NoTag(level);
        }
        if ((bitField0_ & 0x00000002) != 0) {
          output.writeRawByte((byte) 24);
          output.writeUInt32NoTag(slot);
        }
        if ((bitField0_ & 0x00000004) != 0) {
          output.writeRawByte((byte) 40);
          output.writeUInt32NoTag(id);
        }
        if ((bitField0_ & 0x00000008) != 0) {
          output.writeRawByte((byte) 16);
          output.writeEnumNoTag(avatarType);
        }
      }

      @Override
      protected int computeSerializedSize() {
        int size = 0;
        if ((bitField0_ & 0x00000001) != 0) {
          size += 1 + ProtoSink.computeUInt32SizeNoTag(level);
        }
        if ((bitField0_ & 0x00000002) != 0) {
          size += 1 + ProtoSink.computeUInt32SizeNoTag(slot);
        }
        if ((bitField0_ & 0x00000004) != 0) {
          size += 1 + ProtoSink.computeUInt32SizeNoTag(id);
        }
        if ((bitField0_ & 0x00000008) != 0) {
          size += 1 + ProtoSink.computeEnumSizeNoTag(avatarType);
        }
        return size;
      }

      @Override
      @SuppressWarnings("fallthrough")
      public RecordDisplayAvatar mergeFrom(final ProtoSource input) throws IOException {
        // Enabled Fall-Through Optimization (QuickBuffers)
        int tag = input.readTag();
        while (true) {
          switch (tag) {
            case 8: {
              // level
              level = input.readUInt32();
              bitField0_ |= 0x00000001;
              tag = input.readTag();
              if (tag != 24) {
                break;
              }
            }
            case 24: {
              // slot
              slot = input.readUInt32();
              bitField0_ |= 0x00000002;
              tag = input.readTag();
              if (tag != 40) {
                break;
              }
            }
            case 40: {
              // id
              id = input.readUInt32();
              bitField0_ |= 0x00000004;
              tag = input.readTag();
              if (tag != 16) {
                break;
              }
            }
            case 16: {
              // avatarType
              final int value = input.readInt32();
              if (AvatarTypeOuterClass.AvatarType.forNumber(value) != null) {
                avatarType = value;
                bitField0_ |= 0x00000008;
              }
              tag = input.readTag();
              if (tag != 0) {
                break;
              }
            }
            case 0: {
              return this;
            }
            default: {
              if (!input.skipField(tag)) {
                return this;
              }
              tag = input.readTag();
              break;
            }
          }
        }
      }

      @Override
      public void writeTo(final JsonSink output) throws IOException {
        output.beginObject();
        if ((bitField0_ & 0x00000001) != 0) {
          output.writeUInt32(FieldNames.level, level);
        }
        if ((bitField0_ & 0x00000002) != 0) {
          output.writeUInt32(FieldNames.slot, slot);
        }
        if ((bitField0_ & 0x00000004) != 0) {
          output.writeUInt32(FieldNames.id, id);
        }
        if ((bitField0_ & 0x00000008) != 0) {
          output.writeEnum(FieldNames.avatarType, avatarType, AvatarTypeOuterClass.AvatarType.converter());
        }
        output.endObject();
      }

      @Override
      public RecordDisplayAvatar mergeFrom(final JsonSource input) throws IOException {
        if (!input.beginObject()) {
          return this;
        }
        while (!input.isAtEnd()) {
          switch (input.readFieldHash()) {
            case 102865796: {
              if (input.isAtField(FieldNames.level)) {
                if (!input.trySkipNullValue()) {
                  level = input.readUInt32();
                  bitField0_ |= 0x00000001;
                }
              } else {
                input.skipUnknownField();
              }
              break;
            }
            case 3533310: {
              if (input.isAtField(FieldNames.slot)) {
                if (!input.trySkipNullValue()) {
                  slot = input.readUInt32();
                  bitField0_ |= 0x00000002;
                }
              } else {
                input.skipUnknownField();
              }
              break;
            }
            case 3355: {
              if (input.isAtField(FieldNames.id)) {
                if (!input.trySkipNullValue()) {
                  id = input.readUInt32();
                  bitField0_ |= 0x00000004;
                }
              } else {
                input.skipUnknownField();
              }
              break;
            }
            case -403148749:
            case 397309536: {
              if (input.isAtField(FieldNames.avatarType)) {
                if (!input.trySkipNullValue()) {
                  final AvatarTypeOuterClass.AvatarType value = input.readEnum(AvatarTypeOuterClass.AvatarType.converter());
                  if (value != null) {
                    avatarType = value.getNumber();
                    bitField0_ |= 0x00000008;
                  } else {
                    input.skipUnknownEnumValue();
                  }
                }
              } else {
                input.skipUnknownField();
              }
              break;
            }
            default: {
              input.skipUnknownField();
              break;
            }
          }
        }
        input.endObject();
        return this;
      }

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

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

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

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

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

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

      private enum RecordDisplayAvatarFactory implements MessageFactory<RecordDisplayAvatar> {
        INSTANCE;

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

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

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

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

        static final FieldName avatarType = FieldName.forField("avatarType", "avatar_type");
      }
    }

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

      /**
       * <pre>
       * repeated RogueBuff buff_list = 14;
       * </pre>
       *
       * <code>repeated uint32 unk_repeated = 8;</code>
       */
      private final RepeatedInt unkRepeated = RepeatedInt.newEmptyInstance();

      /**
       * <code>repeated .BattleRecordType2.RecordDisplayAvatar avatar_list = 5;</code>
       */
      private final RepeatedMessage<RecordDisplayAvatar> avatarList = RepeatedMessage.newEmptyInstance(RecordDisplayAvatar.getFactory());

      private RecordDisplayInfo() {
      }

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

      /**
       * <pre>
       * repeated RogueBuff buff_list = 14;
       * </pre>
       *
       * <code>repeated uint32 unk_repeated = 8;</code>
       * @return whether the unkRepeated field is set
       */
      public boolean hasUnkRepeated() {
        return (bitField0_ & 0x00000001) != 0;
      }

      /**
       * <pre>
       * repeated RogueBuff buff_list = 14;
       * </pre>
       *
       * <code>repeated uint32 unk_repeated = 8;</code>
       * @return this
       */
      public RecordDisplayInfo clearUnkRepeated() {
        bitField0_ &= ~0x00000001;
        unkRepeated.clear();
        return this;
      }

      /**
       * <pre>
       * repeated RogueBuff buff_list = 14;
       * </pre>
       *
       * <code>repeated uint32 unk_repeated = 8;</code>
       *
       * This method returns the internal storage object without modifying any has state.
       * The returned object should not be modified and be treated as read-only.
       *
       * Use {@link #getMutableUnkRepeated()} if you want to modify it.
       *
       * @return internal storage object for reading
       */
      public RepeatedInt getUnkRepeated() {
        return unkRepeated;
      }

      /**
       * <pre>
       * repeated RogueBuff buff_list = 14;
       * </pre>
       *
       * <code>repeated uint32 unk_repeated = 8;</code>
       *
       * This method returns the internal storage object and sets the corresponding
       * has state. The returned object will become part of this message and its
       * contents may be modified as long as the has state is not cleared.
       *
       * @return internal storage object for modifications
       */
      public RepeatedInt getMutableUnkRepeated() {
        bitField0_ |= 0x00000001;
        return unkRepeated;
      }

      /**
       * <pre>
       * repeated RogueBuff buff_list = 14;
       * </pre>
       *
       * <code>repeated uint32 unk_repeated = 8;</code>
       * @param value the unkRepeated to add
       * @return this
       */
      public RecordDisplayInfo addUnkRepeated(final int value) {
        bitField0_ |= 0x00000001;
        unkRepeated.add(value);
        return this;
      }

      /**
       * <pre>
       * repeated RogueBuff buff_list = 14;
       * </pre>
       *
       * <code>repeated uint32 unk_repeated = 8;</code>
       * @param values the unkRepeated to add
       * @return this
       */
      public RecordDisplayInfo addAllUnkRepeated(final int... values) {
        bitField0_ |= 0x00000001;
        unkRepeated.addAll(values);
        return this;
      }

      /**
       * <code>repeated .BattleRecordType2.RecordDisplayAvatar avatar_list = 5;</code>
       * @return whether the avatarList field is set
       */
      public boolean hasAvatarList() {
        return (bitField0_ & 0x00000002) != 0;
      }

      /**
       * <code>repeated .BattleRecordType2.RecordDisplayAvatar avatar_list = 5;</code>
       * @return this
       */
      public RecordDisplayInfo clearAvatarList() {
        bitField0_ &= ~0x00000002;
        avatarList.clear();
        return this;
      }

      /**
       * <code>repeated .BattleRecordType2.RecordDisplayAvatar avatar_list = 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 #getMutableAvatarList()} if you want to modify it.
       *
       * @return internal storage object for reading
       */
      public RepeatedMessage<RecordDisplayAvatar> getAvatarList() {
        return avatarList;
      }

      /**
       * <code>repeated .BattleRecordType2.RecordDisplayAvatar avatar_list = 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 RepeatedMessage<RecordDisplayAvatar> getMutableAvatarList() {
        bitField0_ |= 0x00000002;
        return avatarList;
      }

      /**
       * <code>repeated .BattleRecordType2.RecordDisplayAvatar avatar_list = 5;</code>
       * @param value the avatarList to add
       * @return this
       */
      public RecordDisplayInfo addAvatarList(final RecordDisplayAvatar value) {
        bitField0_ |= 0x00000002;
        avatarList.add(value);
        return this;
      }

      /**
       * <code>repeated .BattleRecordType2.RecordDisplayAvatar avatar_list = 5;</code>
       * @param values the avatarList to add
       * @return this
       */
      public RecordDisplayInfo addAllAvatarList(final RecordDisplayAvatar... values) {
        bitField0_ |= 0x00000002;
        avatarList.addAll(values);
        return this;
      }

      @Override
      public RecordDisplayInfo copyFrom(final RecordDisplayInfo other) {
        cachedSize = other.cachedSize;
        if ((bitField0_ | other.bitField0_) != 0) {
          bitField0_ = other.bitField0_;
          unkRepeated.copyFrom(other.unkRepeated);
          avatarList.copyFrom(other.avatarList);
        }
        return this;
      }

      @Override
      public RecordDisplayInfo mergeFrom(final RecordDisplayInfo other) {
        if (other.isEmpty()) {
          return this;
        }
        cachedSize = -1;
        if (other.hasUnkRepeated()) {
          getMutableUnkRepeated().addAll(other.unkRepeated);
        }
        if (other.hasAvatarList()) {
          getMutableAvatarList().addAll(other.avatarList);
        }
        return this;
      }

      @Override
      public RecordDisplayInfo clear() {
        if (isEmpty()) {
          return this;
        }
        cachedSize = -1;
        bitField0_ = 0;
        unkRepeated.clear();
        avatarList.clear();
        return this;
      }

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

      @Override
      public boolean equals(Object o) {
        if (o == this) {
          return true;
        }
        if (!(o instanceof RecordDisplayInfo)) {
          return false;
        }
        RecordDisplayInfo other = (RecordDisplayInfo) o;
        return bitField0_ == other.bitField0_
          && (!hasUnkRepeated() || unkRepeated.equals(other.unkRepeated))
          && (!hasAvatarList() || avatarList.equals(other.avatarList));
      }

      @Override
      public void writeTo(final ProtoSink output) throws IOException {
        if ((bitField0_ & 0x00000001) != 0) {
          for (int i = 0; i < unkRepeated.length(); i++) {
            output.writeRawByte((byte) 64);
            output.writeUInt32NoTag(unkRepeated.array()[i]);
          }
        }
        if ((bitField0_ & 0x00000002) != 0) {
          for (int i = 0; i < avatarList.length(); i++) {
            output.writeRawByte((byte) 42);
            output.writeMessageNoTag(avatarList.get(i));
          }
        }
      }

      @Override
      protected int computeSerializedSize() {
        int size = 0;
        if ((bitField0_ & 0x00000001) != 0) {
          size += (1 * unkRepeated.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(unkRepeated);
        }
        if ((bitField0_ & 0x00000002) != 0) {
          size += (1 * avatarList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(avatarList);
        }
        return size;
      }

      @Override
      @SuppressWarnings("fallthrough")
      public RecordDisplayInfo mergeFrom(final ProtoSource input) throws IOException {
        // Enabled Fall-Through Optimization (QuickBuffers)
        int tag = input.readTag();
        while (true) {
          switch (tag) {
            case 66: {
              // unkRepeated [packed=true]
              input.readPackedUInt32(unkRepeated, tag);
              bitField0_ |= 0x00000001;
              tag = input.readTag();
              if (tag != 42) {
                break;
              }
            }
            case 42: {
              // avatarList
              tag = input.readRepeatedMessage(avatarList, tag);
              bitField0_ |= 0x00000002;
              if (tag != 0) {
                break;
              }
            }
            case 0: {
              return this;
            }
            default: {
              if (!input.skipField(tag)) {
                return this;
              }
              tag = input.readTag();
              break;
            }
            case 64: {
              // unkRepeated [packed=false]
              tag = input.readRepeatedUInt32(unkRepeated, tag);
              bitField0_ |= 0x00000001;
              break;
            }
          }
        }
      }

      @Override
      public void writeTo(final JsonSink output) throws IOException {
        output.beginObject();
        if ((bitField0_ & 0x00000001) != 0) {
          output.writeRepeatedUInt32(FieldNames.unkRepeated, unkRepeated);
        }
        if ((bitField0_ & 0x00000002) != 0) {
          output.writeRepeatedMessage(FieldNames.avatarList, avatarList);
        }
        output.endObject();
      }

      @Override
      public RecordDisplayInfo mergeFrom(final JsonSource input) throws IOException {
        if (!input.beginObject()) {
          return this;
        }
        while (!input.isAtEnd()) {
          switch (input.readFieldHash()) {
            case -427796852:
            case -2071716825: {
              if (input.isAtField(FieldNames.unkRepeated)) {
                if (!input.trySkipNullValue()) {
                  input.readRepeatedUInt32(unkRepeated);
                  bitField0_ |= 0x00000001;
                }
              } else {
                input.skipUnknownField();
              }
              break;
            }
            case -403402345:
            case 397055940: {
              if (input.isAtField(FieldNames.avatarList)) {
                if (!input.trySkipNullValue()) {
                  input.readRepeatedMessage(avatarList);
                  bitField0_ |= 0x00000002;
                }
              } else {
                input.skipUnknownField();
              }
              break;
            }
            default: {
              input.skipUnknownField();
              break;
            }
          }
        }
        input.endObject();
        return this;
      }

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

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

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

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

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

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

      private enum RecordDisplayInfoFactory implements MessageFactory<RecordDisplayInfo> {
        INSTANCE;

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

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

        static final FieldName avatarList = FieldName.forField("avatarList", "avatar_list");
      }
    }

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

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

      /**
       * <code>optional uint32 int2 = 1131;</code>
       */
      private int int2;

      /**
       * <code>optional uint32 int1 = 1911;</code>
       */
      private int int1;

      /**
       * <code>optional bool is_win = 4;</code>
       */
      private boolean isWin;

      /**
       * <code>optional .BattleRecordType2.RecordDisplayInfo display_info = 5;</code>
       */
      private final RecordDisplayInfo displayInfo = RecordDisplayInfo.newInstance();

      private RecordType2() {
      }

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

      /**
       * <code>optional uint32 score = 9;</code>
       * @return whether the score field is set
       */
      public boolean hasScore() {
        return (bitField0_ & 0x00000001) != 0;
      }

      /**
       * <code>optional uint32 score = 9;</code>
       * @return this
       */
      public RecordType2 clearScore() {
        bitField0_ &= ~0x00000001;
        score = 0;
        return this;
      }

      /**
       * <code>optional uint32 score = 9;</code>
       * @return the score
       */
      public int getScore() {
        return score;
      }

      /**
       * <code>optional uint32 score = 9;</code>
       * @param value the score to set
       * @return this
       */
      public RecordType2 setScore(final int value) {
        bitField0_ |= 0x00000001;
        score = value;
        return this;
      }

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

      /**
       * <code>optional uint32 int2 = 1131;</code>
       * @return this
       */
      public RecordType2 clearInt2() {
        bitField0_ &= ~0x00000002;
        int2 = 0;
        return this;
      }

      /**
       * <code>optional uint32 int2 = 1131;</code>
       * @return the int2
       */
      public int getInt2() {
        return int2;
      }

      /**
       * <code>optional uint32 int2 = 1131;</code>
       * @param value the int2 to set
       * @return this
       */
      public RecordType2 setInt2(final int value) {
        bitField0_ |= 0x00000002;
        int2 = value;
        return this;
      }

      /**
       * <code>optional uint32 int1 = 1911;</code>
       * @return whether the int1 field is set
       */
      public boolean hasInt1() {
        return (bitField0_ & 0x00000004) != 0;
      }

      /**
       * <code>optional uint32 int1 = 1911;</code>
       * @return this
       */
      public RecordType2 clearInt1() {
        bitField0_ &= ~0x00000004;
        int1 = 0;
        return this;
      }

      /**
       * <code>optional uint32 int1 = 1911;</code>
       * @return the int1
       */
      public int getInt1() {
        return int1;
      }

      /**
       * <code>optional uint32 int1 = 1911;</code>
       * @param value the int1 to set
       * @return this
       */
      public RecordType2 setInt1(final int value) {
        bitField0_ |= 0x00000004;
        int1 = value;
        return this;
      }

      /**
       * <code>optional bool is_win = 4;</code>
       * @return whether the isWin field is set
       */
      public boolean hasIsWin() {
        return (bitField0_ & 0x00000008) != 0;
      }

      /**
       * <code>optional bool is_win = 4;</code>
       * @return this
       */
      public RecordType2 clearIsWin() {
        bitField0_ &= ~0x00000008;
        isWin = false;
        return this;
      }

      /**
       * <code>optional bool is_win = 4;</code>
       * @return the isWin
       */
      public boolean getIsWin() {
        return isWin;
      }

      /**
       * <code>optional bool is_win = 4;</code>
       * @param value the isWin to set
       * @return this
       */
      public RecordType2 setIsWin(final boolean value) {
        bitField0_ |= 0x00000008;
        isWin = value;
        return this;
      }

      /**
       * <code>optional .BattleRecordType2.RecordDisplayInfo display_info = 5;</code>
       * @return whether the displayInfo field is set
       */
      public boolean hasDisplayInfo() {
        return (bitField0_ & 0x00000010) != 0;
      }

      /**
       * <code>optional .BattleRecordType2.RecordDisplayInfo display_info = 5;</code>
       * @return this
       */
      public RecordType2 clearDisplayInfo() {
        bitField0_ &= ~0x00000010;
        displayInfo.clear();
        return this;
      }

      /**
       * <code>optional .BattleRecordType2.RecordDisplayInfo display_info = 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 #getMutableDisplayInfo()} if you want to modify it.
       *
       * @return internal storage object for reading
       */
      public RecordDisplayInfo getDisplayInfo() {
        return displayInfo;
      }

      /**
       * <code>optional .BattleRecordType2.RecordDisplayInfo display_info = 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 RecordDisplayInfo getMutableDisplayInfo() {
        bitField0_ |= 0x00000010;
        return displayInfo;
      }

      /**
       * <code>optional .BattleRecordType2.RecordDisplayInfo display_info = 5;</code>
       * @param value the displayInfo to set
       * @return this
       */
      public RecordType2 setDisplayInfo(final RecordDisplayInfo value) {
        bitField0_ |= 0x00000010;
        displayInfo.copyFrom(value);
        return this;
      }

      @Override
      public RecordType2 copyFrom(final RecordType2 other) {
        cachedSize = other.cachedSize;
        if ((bitField0_ | other.bitField0_) != 0) {
          bitField0_ = other.bitField0_;
          score = other.score;
          int2 = other.int2;
          int1 = other.int1;
          isWin = other.isWin;
          displayInfo.copyFrom(other.displayInfo);
        }
        return this;
      }

      @Override
      public RecordType2 mergeFrom(final RecordType2 other) {
        if (other.isEmpty()) {
          return this;
        }
        cachedSize = -1;
        if (other.hasScore()) {
          setScore(other.score);
        }
        if (other.hasInt2()) {
          setInt2(other.int2);
        }
        if (other.hasInt1()) {
          setInt1(other.int1);
        }
        if (other.hasIsWin()) {
          setIsWin(other.isWin);
        }
        if (other.hasDisplayInfo()) {
          getMutableDisplayInfo().mergeFrom(other.displayInfo);
        }
        return this;
      }

      @Override
      public RecordType2 clear() {
        if (isEmpty()) {
          return this;
        }
        cachedSize = -1;
        bitField0_ = 0;
        score = 0;
        int2 = 0;
        int1 = 0;
        isWin = false;
        displayInfo.clear();
        return this;
      }

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

      @Override
      public boolean equals(Object o) {
        if (o == this) {
          return true;
        }
        if (!(o instanceof RecordType2)) {
          return false;
        }
        RecordType2 other = (RecordType2) o;
        return bitField0_ == other.bitField0_
          && (!hasScore() || score == other.score)
          && (!hasInt2() || int2 == other.int2)
          && (!hasInt1() || int1 == other.int1)
          && (!hasIsWin() || isWin == other.isWin)
          && (!hasDisplayInfo() || displayInfo.equals(other.displayInfo));
      }

      @Override
      public void writeTo(final ProtoSink output) throws IOException {
        if ((bitField0_ & 0x00000001) != 0) {
          output.writeRawByte((byte) 72);
          output.writeUInt32NoTag(score);
        }
        if ((bitField0_ & 0x00000002) != 0) {
          output.writeRawLittleEndian16((short) 18136);
          output.writeUInt32NoTag(int2);
        }
        if ((bitField0_ & 0x00000004) != 0) {
          output.writeRawLittleEndian16((short) 30648);
          output.writeUInt32NoTag(int1);
        }
        if ((bitField0_ & 0x00000008) != 0) {
          output.writeRawByte((byte) 32);
          output.writeBoolNoTag(isWin);
        }
        if ((bitField0_ & 0x00000010) != 0) {
          output.writeRawByte((byte) 42);
          output.writeMessageNoTag(displayInfo);
        }
      }

      @Override
      protected int computeSerializedSize() {
        int size = 0;
        if ((bitField0_ & 0x00000001) != 0) {
          size += 1 + ProtoSink.computeUInt32SizeNoTag(score);
        }
        if ((bitField0_ & 0x00000002) != 0) {
          size += 2 + ProtoSink.computeUInt32SizeNoTag(int2);
        }
        if ((bitField0_ & 0x00000004) != 0) {
          size += 2 + ProtoSink.computeUInt32SizeNoTag(int1);
        }
        if ((bitField0_ & 0x00000008) != 0) {
          size += 2;
        }
        if ((bitField0_ & 0x00000010) != 0) {
          size += 1 + ProtoSink.computeMessageSizeNoTag(displayInfo);
        }
        return size;
      }

      @Override
      @SuppressWarnings("fallthrough")
      public RecordType2 mergeFrom(final ProtoSource input) throws IOException {
        // Enabled Fall-Through Optimization (QuickBuffers)
        int tag = input.readTag();
        while (true) {
          switch (tag) {
            case 72: {
              // score
              score = input.readUInt32();
              bitField0_ |= 0x00000001;
              tag = input.readTag();
              if (tag != 9048) {
                break;
              }
            }
            case 9048: {
              // int2
              int2 = input.readUInt32();
              bitField0_ |= 0x00000002;
              tag = input.readTag();
              if (tag != 15288) {
                break;
              }
            }
            case 15288: {
              // int1
              int1 = input.readUInt32();
              bitField0_ |= 0x00000004;
              tag = input.readTag();
              if (tag != 32) {
                break;
              }
            }
            case 32: {
              // isWin
              isWin = input.readBool();
              bitField0_ |= 0x00000008;
              tag = input.readTag();
              if (tag != 42) {
                break;
              }
            }
            case 42: {
              // displayInfo
              input.readMessage(displayInfo);
              bitField0_ |= 0x00000010;
              tag = input.readTag();
              if (tag != 0) {
                break;
              }
            }
            case 0: {
              return this;
            }
            default: {
              if (!input.skipField(tag)) {
                return this;
              }
              tag = input.readTag();
              break;
            }
          }
        }
      }

      @Override
      public void writeTo(final JsonSink output) throws IOException {
        output.beginObject();
        if ((bitField0_ & 0x00000001) != 0) {
          output.writeUInt32(FieldNames.score, score);
        }
        if ((bitField0_ & 0x00000002) != 0) {
          output.writeUInt32(FieldNames.int2, int2);
        }
        if ((bitField0_ & 0x00000004) != 0) {
          output.writeUInt32(FieldNames.int1, int1);
        }
        if ((bitField0_ & 0x00000008) != 0) {
          output.writeBool(FieldNames.isWin, isWin);
        }
        if ((bitField0_ & 0x00000010) != 0) {
          output.writeMessage(FieldNames.displayInfo, displayInfo);
        }
        output.endObject();
      }

      @Override
      public RecordType2 mergeFrom(final JsonSource input) throws IOException {
        if (!input.beginObject()) {
          return this;
        }
        while (!input.isAtEnd()) {
          switch (input.readFieldHash()) {
            case 109264530: {
              if (input.isAtField(FieldNames.score)) {
                if (!input.trySkipNullValue()) {
                  score = input.readUInt32();
                  bitField0_ |= 0x00000001;
                }
              } else {
                input.skipUnknownField();
              }
              break;
            }
            case 3237411: {
              if (input.isAtField(FieldNames.int2)) {
                if (!input.trySkipNullValue()) {
                  int2 = input.readUInt32();
                  bitField0_ |= 0x00000002;
                }
              } else {
                input.skipUnknownField();
              }
              break;
            }
            case 3237410: {
              if (input.isAtField(FieldNames.int1)) {
                if (!input.trySkipNullValue()) {
                  int1 = input.readUInt32();
                  bitField0_ |= 0x00000004;
                }
              } else {
                input.skipUnknownField();
              }
              break;
            }
            case 100482642:
            case -1179753657: {
              if (input.isAtField(FieldNames.isWin)) {
                if (!input.trySkipNullValue()) {
                  isWin = input.readBool();
                  bitField0_ |= 0x00000008;
                }
              } else {
                input.skipUnknownField();
              }
              break;
            }
            case 1714012304:
            case 1614949899: {
              if (input.isAtField(FieldNames.displayInfo)) {
                if (!input.trySkipNullValue()) {
                  input.readMessage(displayInfo);
                  bitField0_ |= 0x00000010;
                }
              } else {
                input.skipUnknownField();
              }
              break;
            }
            default: {
              input.skipUnknownField();
              break;
            }
          }
        }
        input.endObject();
        return this;
      }

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

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

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

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

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

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

      private enum RecordType2Factory implements MessageFactory<RecordType2> {
        INSTANCE;

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

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

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

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

        static final FieldName isWin = FieldName.forField("isWin", "is_win");

        static final FieldName displayInfo = FieldName.forField("displayInfo", "display_info");
      }
    }

    private enum BattleRecordType2Factory implements MessageFactory<BattleRecordType2> {
      INSTANCE;

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

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

      static final FieldName record = FieldName.forField("record");
    }
  }
}
