当前位置: 首页>>代码示例>>C#>>正文


C# Enums类代码示例

本文整理汇总了C#中Enums的典型用法代码示例。如果您正苦于以下问题:C# Enums类的具体用法?C# Enums怎么用?C# Enums使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Enums类属于命名空间,在下文中一共展示了Enums类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Inventory

 public Inventory(int ID,
     Enums.Entity_Type Entity_Type,
     int Container_ID,
     int Capacity)
 {
     NewInventory(ID, Entity_Type, Container_ID, Capacity);
 }
开发者ID:kidaa,项目名称:ProjectUniverse,代码行数:7,代码来源:Inventory.cs

示例2: MetaDataToEntity

 public MetaDataToEntity(int ID,
     Enums.Entity_Type Entity_Type,
     string MetaData_Key,
     string Value)
 {
     NewMetaDataToEntity(ID, Entity_Type, MetaData_Key, Value);
 }
开发者ID:kidaa,项目名称:ProjectUniverse,代码行数:7,代码来源:MetaDataToEntity.cs

示例3: Change

    public void Change(Enums.Suit cardSuit, Enums.Number cardNumber)
    {
        suit = cardSuit;
           number = cardNumber;

           Refresh();
    }
开发者ID:prizm-labs,项目名称:PokerMultiScreenDemo_HH,代码行数:7,代码来源:PlayingCard.cs

示例4: CreateNewAction

    public override Action_Base CreateNewAction(Enums.ActionType _type, GameObject _object)
    {
        switch (_type)
        {
            case Enums.ActionType.action_click:
                switch(_object.tag)
                {
                    case "attackButton":
                        return new Action_ChangeState(Enums.GameStates.gamestate_AimAttack);
                        break;

                    case "buildButton":
                        if (_object.GetComponent<CanBuildTurret>() != null)
                        {
                            return new Action_Build(Enums.EntityTypes.turret);
                        }
                        else if (_object.GetComponent<CanBuildCrystal>() != null)
                        {
                            return new Action_Build(Enums.EntityTypes.crystal);
                        }
                        break;
                }
                break;
            case Enums.ActionType.action_backUp:
                return new Action_ChangeState(Enums.GameStates.gamestate_waitingForCommand);
                break;
        }
        return null;
    }
开发者ID:wikantsa,项目名称:Projects,代码行数:29,代码来源:State_ActionSelectMenu.cs

示例5: SetBattleStateInRoomCP

    /// <summary>
    /// ルームCP内BattleState要素変更メソッド
    /// <para> 引数に設定された内容でBattleStateの値を更新する。</para>
    /// <para> また、本BattleStateの更新はマスタークライアント側が行う。</para>
    /// </summary>
    /// <param name="newValue">更新する新しいBattleStateの値</param>
    public void SetBattleStateInRoomCP(Enums.BattleState newValue)
    {
        // マスタークライアントでない者が設定しようとした場合は抜ける
        if (!PhotonNetwork.isMasterClient) return;

        roomCP["BS"] = newValue;
    }
开发者ID:yagamiiori,项目名称:UBTProject,代码行数:13,代码来源:RoomCPManager.cs

示例6: switch

 public double this[Enums.Velocity index]
 {
     get
     {
         switch (index)
         {
             case Enums.Velocity.MeterPerSecond:
                 return value;
             case Enums.Velocity.KilometerPerHour:
                 return value*Constants.Hour/Constants.Kilometer;
             case Enums.Velocity.Knots:
                 return value*Constants.Hour/Constants.NMile;
             default:
                 return 0;
         }
     }
     set
     {
         switch (index)
         {
             case Enums.Velocity.MeterPerSecond:
                 this.value = value;
                 break;
             case Enums.Velocity.KilometerPerHour:
                 this.value = value*Constants.Kilometer/Constants.Hour;
                 break;
             case Enums.Velocity.Knots:
                 this.value = value*Constants.NMile/Constants.Hour;
                 break;
             default:
                 break;
         }
     }
 }
开发者ID:VasiliyevAD,项目名称:ship-data-saver,代码行数:34,代码来源:Velocity.cs

示例7: MesFechaString

        public static string MesFechaString(Enums.Meses mes)
        {
            switch (mes)
            {
                case Enums.Meses.Enero:
                    return Properties.Resources.rxEnero;
                case Enums.Meses.Febrero:
                    return Properties.Resources.rxFebrero;
                case Enums.Meses.Marzo:
                    return Properties.Resources.rxMarzo;
                case Enums.Meses.Abril:
                    return Properties.Resources.rxAbril;
                case Enums.Meses.Mayo:
                    return Properties.Resources.rxMayo;
                case Enums.Meses.Junio:
                    return Properties.Resources.rxJunio;
                case Enums.Meses.Julio:
                    return Properties.Resources.rxJulio;
                case Enums.Meses.Agosto:
                    return Properties.Resources.rxAgosto;
                case Enums.Meses.Setiembre:
                    return Properties.Resources.rxSetiembre;
                case Enums.Meses.Octubre:
                    return Properties.Resources.rxOctubre;
                case Enums.Meses.Noviembre:
                    return Properties.Resources.rxNoviembre;
                case Enums.Meses.Diciembre:
                    return Properties.Resources.rxDiciembre;
            }

            return string.Empty;
        }
开发者ID:asdeoz,项目名称:GestRest,代码行数:32,代码来源:CF.cs

示例8: ChangeGameState

    //Change the game state (occurs on next frame)
    public void ChangeGameState(Enums.GameStateNames nextState)
    {
        if (!m_gameStateDictionary.ContainsKey(nextState))
            return;

        m_nextGameStateIndex = nextState;
    }
开发者ID:Abysice,项目名称:Time-Pigs-and-The-Ham-of-Destiny,代码行数:8,代码来源:GameStateManager.cs

示例9: InvalidColumnValue

 public static bool InvalidColumnValue(
     object fieldValue, Enums.Operator op,
     string valueToCompare, Type fieldValueType)
 {
     return ConditionEvaluator.MatchItemValueBasedOnOperatorAndValueType(
         op, valueToCompare, fieldValue, fieldValueType);
 }
开发者ID:karayakar,项目名称:SharePoint,代码行数:7,代码来源:ValidationInjector.cs

示例10: InvalidLengthValue

        public static bool InvalidLengthValue(int length, Enums.Operator op,
            string lengthToCompare)
        {
            int intlengthToCompare;

            if (int.TryParse(lengthToCompare, out intlengthToCompare))
            {
                switch (op)
                {
                    case Enums.Operator.Equal:
                        return length == intlengthToCompare;
                    case Enums.Operator.NotEqual:
                        return length != intlengthToCompare; ;
                    case Enums.Operator.GreaterThan:
                        return length > intlengthToCompare;
                    case Enums.Operator.LessThan:
                        return length < intlengthToCompare;
                    default:
                        return false;
                }
            }
            else
            {
                return true;
            }
        }
开发者ID:karayakar,项目名称:SharePoint,代码行数:26,代码来源:ValidationInjector.cs

示例11: switch

 public double this[Enums.Time index]
 {
     get
     {
         switch (index)
         {
             case Enums.Time.Second:
                 return value;
             case Enums.Time.Minutes:
                 return value/Constants.Minutes;
             case Enums.Time.Hour:
                 return value/Constants.Hour;
             default:
                 return 0;
         }
     }
     set
     {
         switch (index)
         {
             case Enums.Time.Second:
                 this.value = value;
                 break;
             case Enums.Time.Minutes:
                 this.value = value*Constants.Minutes;
                 break;
             case Enums.Time.Hour:
                 this.value = value*Constants.Hour;
                 break;
             default:
                 break;
         }
     }
 }
开发者ID:VasiliyevAD,项目名称:ship-data-saver,代码行数:34,代码来源:Time.cs

示例12: ContainersCore

 //заполнение параметров контейнера
 protected ContainersCore(Enums.ContainerType containerType, int id, double area, double dencity)
 {
     this.containerType = containerType;
     this.area = area;
     this.dencity = dencity;
     this.id = id;
 }
开发者ID:KseniiaKen,项目名称:MAS,代码行数:8,代码来源:ContainersCore.cs

示例13: CreateTurret

        //===================================================
        // PUBLIC METHODS
        //===================================================
        /// <summary>
        /// Creates a turret.
        /// </summary>
        /// <param name="turretType">Type of the turret.</param>
        /// <param name="position">The position.</param>
        public void CreateTurret( Enums.TurretType turretType, Vector3 position )
        {
            GameObject tempGO = null;
            switch( turretType ) {
                case Enums.TurretType.Type_A:
                    tempGO = turretPrefabA;
                    break;
                case Enums.TurretType.Type_B:
                    tempGO = turretPrefabB;
                    break;
                case Enums.TurretType.Type_C:
                    tempGO = turretPrefabC;
                    break;
                case Enums.TurretType.Type_D:
                    tempGO = turretPrefabD;
                    break;
                default:
                    tempGO = turretPrefabA;
                    break;
            }

            GameObject turretGO = Instantiate( tempGO, position, Quaternion.identity ) as GameObject;
            turretGO.transform.SetParent( turretContainer );

            turrets.Add( turretGO );
        }
开发者ID:hadeszs,项目名称:TowerDefence-orign,代码行数:34,代码来源:TurretManager.cs

示例14: Move

    public void Move(Enums.ActionType _type)
    {
        int _oldX;
        int _oldY;
        switch(_type)
        {
            case Enums.ActionType.action_right:
                _oldX = storage.xPos;
                _oldY = storage.yPos;

                storage.GameWorld.RemoveObjectFromTile(_oldX, _oldY, this.gameObject);
                storage.xPos = _oldX + 1;
                storage.yPos = storage.GameWorld.GetColumnHeight(storage.xPos);
                storage.GameWorld.AddObjectToTile(storage.xPos, storage.yPos, this.gameObject);

                this.gameObject.transform.Translate(1,storage.yPos - _oldY,0);
                break;
            case Enums.ActionType.action_left:
                _oldX = storage.xPos;
                _oldY = storage.yPos;

                storage.GameWorld.RemoveObjectFromTile(_oldX, _oldY, this.gameObject);
                storage.xPos = _oldX - 1;
                storage.yPos = storage.GameWorld.GetColumnHeight(storage.xPos);
                storage.GameWorld.AddObjectToTile(storage.xPos, storage.yPos, this.gameObject);

                this.gameObject.transform.Translate(-1,storage.yPos - _oldY,0);
                break;
        }
    }
开发者ID:wikantsa,项目名称:Projects,代码行数:30,代码来源:GroundMovement.cs

示例15: ReturnObject

 public ReturnObject(Enums.Return_Status Return_Status,
     string Friendly_Message,
     string Technical_Message,
     object Return_Object)
 {
     NewReturnObject(Return_Status, Friendly_Message, Technical_Message, Return_Object, string.Empty);
 }
开发者ID:kidaa,项目名称:ProjectUniverse,代码行数:7,代码来源:ReturnObject.cs


注:本文中的Enums类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。