// 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 AvatarTypeOuterClass {
  /**
   * Protobuf enum {@code AvatarType}
   */
  public enum AvatarType implements ProtoEnum<AvatarType> {
    /**
     * <code>AVATAR_TYPE_NONE = 0;</code>
     */
    AVATAR_TYPE_NONE("AVATAR_TYPE_NONE", 0),

    /**
     * <code>AVATAR_TRIAL_TYPE = 1;</code>
     */
    AVATAR_TRIAL_TYPE("AVATAR_TRIAL_TYPE", 1),

    /**
     * <code>AVATAR_LIMIT_TYPE = 2;</code>
     */
    AVATAR_LIMIT_TYPE("AVATAR_LIMIT_TYPE", 2),

    /**
     * <code>AVATAR_FORMAL_TYPE = 3;</code>
     */
    AVATAR_FORMAL_TYPE("AVATAR_FORMAL_TYPE", 3),

    /**
     * <code>AVATAR_ASSIST_TYPE = 4;</code>
     */
    AVATAR_ASSIST_TYPE("AVATAR_ASSIST_TYPE", 4);

    /**
     * <code>AVATAR_TYPE_NONE = 0;</code>
     */
    public static final int AVATAR_TYPE_NONE_VALUE = 0;

    /**
     * <code>AVATAR_TRIAL_TYPE = 1;</code>
     */
    public static final int AVATAR_TRIAL_TYPE_VALUE = 1;

    /**
     * <code>AVATAR_LIMIT_TYPE = 2;</code>
     */
    public static final int AVATAR_LIMIT_TYPE_VALUE = 2;

    /**
     * <code>AVATAR_FORMAL_TYPE = 3;</code>
     */
    public static final int AVATAR_FORMAL_TYPE_VALUE = 3;

    /**
     * <code>AVATAR_ASSIST_TYPE = 4;</code>
     */
    public static final int AVATAR_ASSIST_TYPE_VALUE = 4;

    private final String name;

    private final int number;

    private AvatarType(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<AvatarType> converter() {
      return AvatarTypeConverter.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 AvatarType forNumber(int value) {
      return AvatarTypeConverter.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 AvatarType forNumberOr(int number, AvatarType other) {
      AvatarType value = forNumber(number);
      return value == null ? other : value;
    }

    enum AvatarTypeConverter implements ProtoEnum.EnumConverter<AvatarType> {
      INSTANCE;

      private static final AvatarType[] lookup = new AvatarType[5];

      static {
        lookup[0] = AVATAR_TYPE_NONE;
        lookup[1] = AVATAR_TRIAL_TYPE;
        lookup[2] = AVATAR_LIMIT_TYPE;
        lookup[3] = AVATAR_FORMAL_TYPE;
        lookup[4] = AVATAR_ASSIST_TYPE;
      }

      @Override
      public final AvatarType forNumber(final int value) {
        if (value >= 0 && value < lookup.length) {
          return lookup[value];
        }
        return null;
      }

      @Override
      public final AvatarType forName(final CharSequence value) {
        if (value.length() == 16) {
          if (ProtoUtil.isEqual("AVATAR_TYPE_NONE", value)) {
            return AVATAR_TYPE_NONE;
          }
        }
        if (value.length() == 17) {
          if (ProtoUtil.isEqual("AVATAR_TRIAL_TYPE", value)) {
            return AVATAR_TRIAL_TYPE;
          }
          if (ProtoUtil.isEqual("AVATAR_LIMIT_TYPE", value)) {
            return AVATAR_LIMIT_TYPE;
          }
        }
        if (value.length() == 18) {
          if (ProtoUtil.isEqual("AVATAR_FORMAL_TYPE", value)) {
            return AVATAR_FORMAL_TYPE;
          }
          if (ProtoUtil.isEqual("AVATAR_ASSIST_TYPE", value)) {
            return AVATAR_ASSIST_TYPE;
          }
        }
        return null;
      }
    }
  }
}
