// Code generated by protocol buffer compiler. Do not edit!
package emu.lunarcore.proto;

import us.hebi.quickbuf.ProtoEnum;
import us.hebi.quickbuf.ProtoUtil;

public final class MapInfoChestTypeOuterClass {
  /**
   * Protobuf enum {@code MapInfoChestType}
   */
  public enum MapInfoChestType implements ProtoEnum<MapInfoChestType> {
    /**
     * <code>MAP_INFO_CHEST_TYPE_NONE = 0;</code>
     */
    MAP_INFO_CHEST_TYPE_NONE("MAP_INFO_CHEST_TYPE_NONE", 0),

    /**
     * <code>MAP_INFO_CHEST_TYPE_NORMAL = 101;</code>
     */
    MAP_INFO_CHEST_TYPE_NORMAL("MAP_INFO_CHEST_TYPE_NORMAL", 101),

    /**
     * <code>MAP_INFO_CHEST_TYPE_CHALLENGE = 102;</code>
     */
    MAP_INFO_CHEST_TYPE_CHALLENGE("MAP_INFO_CHEST_TYPE_CHALLENGE", 102),

    /**
     * <code>MAP_INFO_CHEST_TYPE_PUZZLE = 104;</code>
     */
    MAP_INFO_CHEST_TYPE_PUZZLE("MAP_INFO_CHEST_TYPE_PUZZLE", 104);

    /**
     * <code>MAP_INFO_CHEST_TYPE_NONE = 0;</code>
     */
    public static final int MAP_INFO_CHEST_TYPE_NONE_VALUE = 0;

    /**
     * <code>MAP_INFO_CHEST_TYPE_NORMAL = 101;</code>
     */
    public static final int MAP_INFO_CHEST_TYPE_NORMAL_VALUE = 101;

    /**
     * <code>MAP_INFO_CHEST_TYPE_CHALLENGE = 102;</code>
     */
    public static final int MAP_INFO_CHEST_TYPE_CHALLENGE_VALUE = 102;

    /**
     * <code>MAP_INFO_CHEST_TYPE_PUZZLE = 104;</code>
     */
    public static final int MAP_INFO_CHEST_TYPE_PUZZLE_VALUE = 104;

    private final String name;

    private final int number;

    private MapInfoChestType(String name, int number) {
      this.name = name;
      this.number = number;
    }

    /**
     * @return the string representation of enum entry
     */
    @Override
    public String getName() {
      return name;
    }

    /**
     * @return the numeric wire value of this enum entry
     */
    @Override
    public int getNumber() {
      return number;
    }

    /**
     * @return a converter that maps between this enum's numeric and text representations
     */
    public static ProtoEnum.EnumConverter<MapInfoChestType> converter() {
      return MapInfoChestTypeConverter.INSTANCE;
    }

    /**
     * @param value The numeric wire value of the corresponding enum entry.
     * @return The enum associated with the given numeric wire value, or null if unknown.
     */
    public static MapInfoChestType forNumber(int value) {
      return MapInfoChestTypeConverter.INSTANCE.forNumber(value);
    }

    /**
     * @param value The numeric wire value of the corresponding enum entry.
     * @param other Fallback value in case the value is not known.
     * @return The enum associated with the given numeric wire value, or the fallback value if unknown.
     */
    public static MapInfoChestType forNumberOr(int number, MapInfoChestType other) {
      MapInfoChestType value = forNumber(number);
      return value == null ? other : value;
    }

    enum MapInfoChestTypeConverter implements ProtoEnum.EnumConverter<MapInfoChestType> {
      INSTANCE;

      @Override
      public final MapInfoChestType forNumber(final int value) {
        switch(value) {
          case 0: return MAP_INFO_CHEST_TYPE_NONE;
          case 101: return MAP_INFO_CHEST_TYPE_NORMAL;
          case 102: return MAP_INFO_CHEST_TYPE_CHALLENGE;
          case 104: return MAP_INFO_CHEST_TYPE_PUZZLE;
          default: return null;
        }
      }

      @Override
      public final MapInfoChestType forName(final CharSequence value) {
        if (value.length() == 24) {
          if (ProtoUtil.isEqual("MAP_INFO_CHEST_TYPE_NONE", value)) {
            return MAP_INFO_CHEST_TYPE_NONE;
          }
        }
        if (value.length() == 26) {
          if (ProtoUtil.isEqual("MAP_INFO_CHEST_TYPE_NORMAL", value)) {
            return MAP_INFO_CHEST_TYPE_NORMAL;
          }
          if (ProtoUtil.isEqual("MAP_INFO_CHEST_TYPE_PUZZLE", value)) {
            return MAP_INFO_CHEST_TYPE_PUZZLE;
          }
        }
        if (value.length() == 29) {
          if (ProtoUtil.isEqual("MAP_INFO_CHEST_TYPE_CHALLENGE", value)) {
            return MAP_INFO_CHEST_TYPE_CHALLENGE;
          }
        }
        return null;
      }
    }
  }
}
