<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: ModuleId.proto

namespace Game\Protobuf;

use UnexpectedValueException;

/**
 * Protobuf type <code>Game.Protobuf.ModuleId</code>
 */
class ModuleId
{
    /**
     * Generated from protobuf enum <code>None = 0;</code>
     */
    const None = 0;
    /**
     * Generated from protobuf enum <code>Account = 1;</code>
     */
    const Account = 1;
    /**
     * Generated from protobuf enum <code>Storehouse = 2;</code>
     */
    const Storehouse = 2;
    /**
     * Generated from protobuf enum <code>RacingCar = 3;</code>
     */
    const RacingCar = 3;
    /**
     *排位赛段位
     *
     * Generated from protobuf enum <code>SeasonRank = 4;</code>
     */
    const SeasonRank = 4;
    /**
     * Generated from protobuf enum <code>Skill = 6;</code>
     */
    const Skill = 6;
    /**
     * Generated from protobuf enum <code>Friend = 7;</code>
     */
    const Friend = 7;
    /**
     * 汽车外观改装
     *
     * Generated from protobuf enum <code>ExteriorRefit = 8;</code>
     */
    const ExteriorRefit = 8;
    /**
     * 玩家自己的俱乐部模块
     *
     * Generated from protobuf enum <code>MyClubInfo = 15;</code>
     */
    const MyClubInfo = 15;
    /**
     * 排位赛数据
     *
     * Generated from protobuf enum <code>Ranking = 16;</code>
     */
    const Ranking = 16;

    private static $valueToName = [
        self::None => 'None',
        self::Account => 'Account',
        self::Storehouse => 'Storehouse',
        self::RacingCar => 'RacingCar',
        self::SeasonRank => 'SeasonRank',
        self::Skill => 'Skill',
        self::Friend => 'Friend',
        self::ExteriorRefit => 'ExteriorRefit',
        self::MyClubInfo => 'MyClubInfo',
        self::Ranking => 'Ranking',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }


    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}

