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

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

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

    /**
     * <code>ENTER_SCENE_REASON_NONE = 0;</code>
     */
    public static final int ENTER_SCENE_REASON_NONE_VALUE = 0;

    /**
     * <code>ENTER_SCENE_REASON_CHALLENGE_TIMEOUT = 1;</code>
     */
    public static final int ENTER_SCENE_REASON_CHALLENGE_TIMEOUT_VALUE = 1;

    /**
     * <code>ENTER_SCENE_REASON_ROGUE_TIMEOUT = 2;</code>
     */
    public static final int ENTER_SCENE_REASON_ROGUE_TIMEOUT_VALUE = 2;

    private final String name;

    private final int number;

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

    enum EnterSceneReasonConverter implements ProtoEnum.EnumConverter<EnterSceneReason> {
      INSTANCE;

      private static final EnterSceneReason[] lookup = new EnterSceneReason[3];

      static {
        lookup[0] = ENTER_SCENE_REASON_NONE;
        lookup[1] = ENTER_SCENE_REASON_CHALLENGE_TIMEOUT;
        lookup[2] = ENTER_SCENE_REASON_ROGUE_TIMEOUT;
      }

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

      @Override
      public final EnterSceneReason forName(final CharSequence value) {
        if (value.length() == 23) {
          if (ProtoUtil.isEqual("ENTER_SCENE_REASON_NONE", value)) {
            return ENTER_SCENE_REASON_NONE;
          }
        }
        if (value.length() == 32) {
          if (ProtoUtil.isEqual("ENTER_SCENE_REASON_ROGUE_TIMEOUT", value)) {
            return ENTER_SCENE_REASON_ROGUE_TIMEOUT;
          }
        }
        if (value.length() == 36) {
          if (ProtoUtil.isEqual("ENTER_SCENE_REASON_CHALLENGE_TIMEOUT", value)) {
            return ENTER_SCENE_REASON_CHALLENGE_TIMEOUT;
          }
        }
        return null;
      }
    }
  }
}
