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


C# Switch.getState方法代码示例

本文整理汇总了C#中System.Switch.getState方法的典型用法代码示例。如果您正苦于以下问题:C# Switch.getState方法的具体用法?C# Switch.getState怎么用?C# Switch.getState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Switch的用法示例。


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

示例1: LoadContent


//.........这里部分代码省略.........

            // starts new game or goes to main menu depending on choice
            Button.ClickHandler[] playAgainAction = new Button.ClickHandler[2];
            // if playagain is chosen from the menu, following options are available
            playAgainAction[0] = delegate() {
                player1.Reset(); player2.Reset(); computer.Reset();
                if (speed != null)
                {
                    // switch based on what speed game type is being played
                    switch (speed.myType)
                    {
                        //
                            // game length?
                        case Speed.gameType.Timed:
                            int x = speed.gameLength;
                            speed = new Speed(cards, background, selector, font, speed.you, speed.opp, textures, speed.myType, shuffle, playcard, shuffleinstance, SoundSwitch.getOnOff(), PowerUpSwitch.getOnOff(), vibrateOn, freeze);
                            speed.gameLength = x;
                            break;
                        //
                        case Speed.gameType.Marathon:
                            int y = speed.winningscore;
                            speed = new Speed(cards, background, selector, font, speed.you, speed.opp, textures, speed.myType, shuffle, playcard, shuffleinstance, SoundSwitch.getOnOff(), PowerUpSwitch.getOnOff(), vibrateOn, freeze);
                            speed.winningscore = y;
                            break;
                        // if neither of the other cases apply, do this default action
                        default:
                            speed = new Speed(cards, background, selector, font, speed.you, speed.opp, textures, speed.myType, shuffle, playcard, shuffleinstance, SoundSwitch.getOnOff(), PowerUpSwitch.getOnOff(), vibrateOn, freeze);
                            break;
                    }
                    speed.TurnOn(); PlayAgain.isPaused = true;
                }

                if (levels != null) {
                    levels = new Levels(cards, background, selector, font, levels._player1, textures, shuffle, playcard, shuffleinstance, SoundSwitch.getOnOff(), PowerUpSwitch.getOnOff(), vibrateOn, (Levels.Difficulty) DifficultySwitch.getState(), freeze);
                    levels.StartGame();
                    PlayAgain.isPaused = true;
                }
            };
            // if exit is chosen, nullifies levels or speed, returns to main menu
            playAgainAction[1] = delegate()
            {
                if (speed != null) speed = null;
                if (levels != null) levels = null;
                PlayAgain.isPaused = true; MainMenu.isPaused = false;
            };

            // makes playagain menu
            PlayAgain = new Menu(playAgainBackground, 2, playAgain, PAButtonNames, playAgainAction, font, 100, true);
            #endregion

            #region PauseMenu
            // creates pause menu title
            Text pause = new Text("Pause", font)
            {
                attributes = new Attributes()
                {
                    color = Color.Black,
                    //rotation = -.1f,
                    depth = 0f,
                },
                height = 300
            };

            // makes names for each button on pause menu
            String[] pauseNames = new String[5];
            pauseNames[0] = "Resume";
开发者ID:rabdureh,项目名称:SPEGame,代码行数:67,代码来源:Game1.cs


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