// 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;

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

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

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

    /**
     * <code>optional uint32 star_count = 6;</code>
     */
    private int starCount;

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

    /**
     * <code>optional uint32 season_id = 15;</code>
     */
    private int seasonId;

    private PlayerMocDisplayInfo() {
    }

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

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

    /**
     * <code>optional uint32 int1 = 1;</code>
     * @return this
     */
    public PlayerMocDisplayInfo clearInt1() {
      bitField0_ &= ~0x00000001;
      int1 = 0;
      return this;
    }

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

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

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

    /**
     * <code>optional uint32 int3 = 3;</code>
     * @return this
     */
    public PlayerMocDisplayInfo clearInt3() {
      bitField0_ &= ~0x00000002;
      int3 = 0;
      return this;
    }

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

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

    /**
     * <code>optional uint32 star_count = 6;</code>
     * @return whether the starCount field is set
     */
    public boolean hasStarCount() {
      return (bitField0_ & 0x00000004) != 0;
    }

    /**
     * <code>optional uint32 star_count = 6;</code>
     * @return this
     */
    public PlayerMocDisplayInfo clearStarCount() {
      bitField0_ &= ~0x00000004;
      starCount = 0;
      return this;
    }

    /**
     * <code>optional uint32 star_count = 6;</code>
     * @return the starCount
     */
    public int getStarCount() {
      return starCount;
    }

    /**
     * <code>optional uint32 star_count = 6;</code>
     * @param value the starCount to set
     * @return this
     */
    public PlayerMocDisplayInfo setStarCount(final int value) {
      bitField0_ |= 0x00000004;
      starCount = value;
      return this;
    }

    /**
     * <code>optional uint32 floor_num = 14;</code>
     * @return whether the floorNum field is set
     */
    public boolean hasFloorNum() {
      return (bitField0_ & 0x00000008) != 0;
    }

    /**
     * <code>optional uint32 floor_num = 14;</code>
     * @return this
     */
    public PlayerMocDisplayInfo clearFloorNum() {
      bitField0_ &= ~0x00000008;
      floorNum = 0;
      return this;
    }

    /**
     * <code>optional uint32 floor_num = 14;</code>
     * @return the floorNum
     */
    public int getFloorNum() {
      return floorNum;
    }

    /**
     * <code>optional uint32 floor_num = 14;</code>
     * @param value the floorNum to set
     * @return this
     */
    public PlayerMocDisplayInfo setFloorNum(final int value) {
      bitField0_ |= 0x00000008;
      floorNum = value;
      return this;
    }

    /**
     * <code>optional uint32 season_id = 15;</code>
     * @return whether the seasonId field is set
     */
    public boolean hasSeasonId() {
      return (bitField0_ & 0x00000010) != 0;
    }

    /**
     * <code>optional uint32 season_id = 15;</code>
     * @return this
     */
    public PlayerMocDisplayInfo clearSeasonId() {
      bitField0_ &= ~0x00000010;
      seasonId = 0;
      return this;
    }

    /**
     * <code>optional uint32 season_id = 15;</code>
     * @return the seasonId
     */
    public int getSeasonId() {
      return seasonId;
    }

    /**
     * <code>optional uint32 season_id = 15;</code>
     * @param value the seasonId to set
     * @return this
     */
    public PlayerMocDisplayInfo setSeasonId(final int value) {
      bitField0_ |= 0x00000010;
      seasonId = value;
      return this;
    }

    @Override
    public PlayerMocDisplayInfo copyFrom(final PlayerMocDisplayInfo other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        int1 = other.int1;
        int3 = other.int3;
        starCount = other.starCount;
        floorNum = other.floorNum;
        seasonId = other.seasonId;
      }
      return this;
    }

    @Override
    public PlayerMocDisplayInfo mergeFrom(final PlayerMocDisplayInfo other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasInt1()) {
        setInt1(other.int1);
      }
      if (other.hasInt3()) {
        setInt3(other.int3);
      }
      if (other.hasStarCount()) {
        setStarCount(other.starCount);
      }
      if (other.hasFloorNum()) {
        setFloorNum(other.floorNum);
      }
      if (other.hasSeasonId()) {
        setSeasonId(other.seasonId);
      }
      return this;
    }

    @Override
    public PlayerMocDisplayInfo clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      int1 = 0;
      int3 = 0;
      starCount = 0;
      floorNum = 0;
      seasonId = 0;
      return this;
    }

    @Override
    public PlayerMocDisplayInfo 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 PlayerMocDisplayInfo)) {
        return false;
      }
      PlayerMocDisplayInfo other = (PlayerMocDisplayInfo) o;
      return bitField0_ == other.bitField0_
        && (!hasInt1() || int1 == other.int1)
        && (!hasInt3() || int3 == other.int3)
        && (!hasStarCount() || starCount == other.starCount)
        && (!hasFloorNum() || floorNum == other.floorNum)
        && (!hasSeasonId() || seasonId == other.seasonId);
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawByte((byte) 8);
        output.writeUInt32NoTag(int1);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRawByte((byte) 24);
        output.writeUInt32NoTag(int3);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRawByte((byte) 48);
        output.writeUInt32NoTag(starCount);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeRawByte((byte) 112);
        output.writeUInt32NoTag(floorNum);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeRawByte((byte) 120);
        output.writeUInt32NoTag(seasonId);
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(int1);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(int3);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(starCount);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(floorNum);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(seasonId);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public PlayerMocDisplayInfo mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 8: {
            // int1
            int1 = input.readUInt32();
            bitField0_ |= 0x00000001;
            tag = input.readTag();
            if (tag != 24) {
              break;
            }
          }
          case 24: {
            // int3
            int3 = input.readUInt32();
            bitField0_ |= 0x00000002;
            tag = input.readTag();
            if (tag != 48) {
              break;
            }
          }
          case 48: {
            // starCount
            starCount = input.readUInt32();
            bitField0_ |= 0x00000004;
            tag = input.readTag();
            if (tag != 112) {
              break;
            }
          }
          case 112: {
            // floorNum
            floorNum = input.readUInt32();
            bitField0_ |= 0x00000008;
            tag = input.readTag();
            if (tag != 120) {
              break;
            }
          }
          case 120: {
            // seasonId
            seasonId = input.readUInt32();
            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.int1, int1);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeUInt32(FieldNames.int3, int3);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeUInt32(FieldNames.starCount, starCount);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeUInt32(FieldNames.floorNum, floorNum);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeUInt32(FieldNames.seasonId, seasonId);
      }
      output.endObject();
    }

    @Override
    public PlayerMocDisplayInfo mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case 3237410: {
            if (input.isAtField(FieldNames.int1)) {
              if (!input.trySkipNullValue()) {
                int1 = input.readUInt32();
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 3237412: {
            if (input.isAtField(FieldNames.int3)) {
              if (!input.trySkipNullValue()) {
                int3 = input.readUInt32();
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 2121235933:
          case 2124166370: {
            if (input.isAtField(FieldNames.starCount)) {
              if (!input.trySkipNullValue()) {
                starCount = input.readUInt32();
                bitField0_ |= 0x00000004;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 2022966234:
          case -1712056109: {
            if (input.isAtField(FieldNames.floorNum)) {
              if (!input.trySkipNullValue()) {
                floorNum = input.readUInt32();
                bitField0_ |= 0x00000008;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 889931614:
          case 1818097655: {
            if (input.isAtField(FieldNames.seasonId)) {
              if (!input.trySkipNullValue()) {
                seasonId = input.readUInt32();
                bitField0_ |= 0x00000010;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

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

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

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

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

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

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

    private enum PlayerMocDisplayInfoFactory implements MessageFactory<PlayerMocDisplayInfo> {
      INSTANCE;

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

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

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

      static final FieldName starCount = FieldName.forField("starCount", "star_count");

      static final FieldName floorNum = FieldName.forField("floorNum", "floor_num");

      static final FieldName seasonId = FieldName.forField("seasonId", "season_id");
    }
  }
}
