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


C# Game.PlayTurn方法代码示例

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


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

示例1: GameDoesNotAllowRepeatedPlayInPosition

        public void GameDoesNotAllowRepeatedPlayInPosition()
        {
            var g = new Game();
            var playerType = PlayerType.X;

            g.PlayTurn(playerType, 2, 2);
            g.PlayTurn(PlayerType.O, 0, 2);
            
            //Should throw Ex:
            g.PlayTurn(playerType, 2, 2);

        }
开发者ID:RyanBetker,项目名称:Kata.TicTacToe,代码行数:12,代码来源:GameTests.cs

示例2: GameDoesNotAllowColumnOver2

        public void GameDoesNotAllowColumnOver2()
        {
            var g = new Game();
            var playerType = PlayerType.X;

            g.PlayTurn(playerType, 2, 3);

        }
开发者ID:RyanBetker,项目名称:Kata.TicTacToe,代码行数:8,代码来源:GameTests.cs

示例3: GameDoesNotAllowRowOver2

        public void GameDoesNotAllowRowOver2()
        {
            var g = new Game();
            var playerType = PlayerType.X;

            g.PlayTurn(playerType, 3, 1);

        }
开发者ID:RyanBetker,项目名称:Kata.TicTacToe,代码行数:8,代码来源:GameTests.cs

示例4: GameDoesNotAllowColumnUnder0

        public void GameDoesNotAllowColumnUnder0()
        {
            var g = new Game();
            var playerType = PlayerType.X;

            g.PlayTurn(playerType, -1, 0);

        }
开发者ID:RyanBetker,项目名称:Kata.TicTacToe,代码行数:8,代码来源:GameTests.cs

示例5: GameStoresPositionTopLeft

        public void GameStoresPositionTopLeft()
        {
            var g = new Game();
            var playerType = PlayerType.X;

            g.PlayTurn(playerType, 0, 0);

            Assert.AreEqual(playerType, g.Board[0, 0]);
        }
开发者ID:RyanBetker,项目名称:Kata.TicTacToe,代码行数:9,代码来源:GameTests.cs

示例6: GameDoesNotAllowDoublePlay

        public void GameDoesNotAllowDoublePlay()
        {
            var g = new Game();
            var playerType = PlayerType.X;

            g.PlayTurn(playerType, 2, 2);

            //Should throw Ex:
            g.PlayTurn(playerType, 1, 2);

        }
开发者ID:RyanBetker,项目名称:Kata.TicTacToe,代码行数:11,代码来源:GameTests.cs

示例7: GameWithLineXHasWinner

        public void GameWithLineXHasWinner()
        {
            var g = new Game();
            var playerType = PlayerType.X;
            var secondPlayer = PlayerType.O;

            g.PlayTurn(playerType, 0, 0);
            g.PlayTurn(secondPlayer, 2, 0);
            g.PlayTurn(playerType, 0, 1);
            g.PlayTurn(secondPlayer, 2, 1);
            g.PlayTurn(playerType, 0, 2);
            PlayerType? winner = g.DetermineWinner();

            Assert.AreEqual(playerType, winner);
        }
开发者ID:RyanBetker,项目名称:Kata.TicTacToe,代码行数:15,代码来源:GameTests.cs

示例8: GameHasNoWinnerWithoutLine

        public void GameHasNoWinnerWithoutLine()
        {
            var g = new Game();
            var playerType = PlayerType.O;

            g.PlayTurn(playerType, 0, 0);
            g.PlayTurn(PlayerType.X, 2, 0);
            g.PlayTurn(playerType, 0, 1); 
            PlayerType? winner = g.DetermineWinner();

            Assert.AreEqual(null, winner);
        }
开发者ID:RyanBetker,项目名称:Kata.TicTacToe,代码行数:12,代码来源:GameTests.cs

示例9: GameStoresAccuratePlayer

        public void GameStoresAccuratePlayer()
        {
            var g = new Game();
            var playerType = PlayerType.O;

            g.PlayTurn(playerType, 0, 0);

            Assert.AreEqual(playerType, g.Board[0, 0]);
        }
开发者ID:RyanBetker,项目名称:Kata.TicTacToe,代码行数:9,代码来源:GameTests.cs


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