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

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

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

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

    /**
     * <code>CHALLENGE_UNKNOWN = 0;</code>
     */
    public static final int CHALLENGE_UNKNOWN_VALUE = 0;

    /**
     * <code>CHALLENGE_DOING = 1;</code>
     */
    public static final int CHALLENGE_DOING_VALUE = 1;

    /**
     * <code>CHALLENGE_FINISH = 2;</code>
     */
    public static final int CHALLENGE_FINISH_VALUE = 2;

    /**
     * <code>CHALLENGE_FAILED = 3;</code>
     */
    public static final int CHALLENGE_FAILED_VALUE = 3;

    private final String name;

    private final int number;

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

    enum ChallengeStatusConverter implements ProtoEnum.EnumConverter<ChallengeStatus> {
      INSTANCE;

      private static final ChallengeStatus[] lookup = new ChallengeStatus[4];

      static {
        lookup[0] = CHALLENGE_UNKNOWN;
        lookup[1] = CHALLENGE_DOING;
        lookup[2] = CHALLENGE_FINISH;
        lookup[3] = CHALLENGE_FAILED;
      }

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

      @Override
      public final ChallengeStatus forName(final CharSequence value) {
        if (value.length() == 15) {
          if (ProtoUtil.isEqual("CHALLENGE_DOING", value)) {
            return CHALLENGE_DOING;
          }
        }
        if (value.length() == 16) {
          if (ProtoUtil.isEqual("CHALLENGE_FINISH", value)) {
            return CHALLENGE_FINISH;
          }
          if (ProtoUtil.isEqual("CHALLENGE_FAILED", value)) {
            return CHALLENGE_FAILED;
          }
        }
        if (value.length() == 17) {
          if (ProtoUtil.isEqual("CHALLENGE_UNKNOWN", value)) {
            return CHALLENGE_UNKNOWN;
          }
        }
        return null;
      }
    }
  }
}
