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


C# Game.CanSelectChecker方法代码示例

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


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

示例1: _003_Second_Player_Cannot_Select_White_Checkers

        public void _003_Second_Player_Cannot_Select_White_Checkers()
        {
            var game = new Game
            {
                Board = new Board(),
                Player1 = new FakePlayer(true),
                Player2 = new FakePlayer(false),
                CheckersSet = new List<Checker>
                {
                    new Checker(true, true,   new Coordinate(2, 1)),
                    new Checker(true, false,  new Coordinate(3, 4)),
                    new Checker(false, false, new Coordinate(1, 2)),
                    new Checker(false, false, new Coordinate(2, 5)),
                    new Checker(false, false, new Coordinate(4, 5)),
                }
            };
            game.CurrentPlayer = game.Player2;

            var whiteChecker = game.CheckersSet[0];
            var canSelectWhiteChecker = game.CanSelectChecker(whiteChecker);

            Assert.IsFalse(canSelectWhiteChecker);
        }
开发者ID:kolinlob,项目名称:Checkers,代码行数:23,代码来源:PlayerTests.cs

示例2: _002_First_Player_Cannot_Select_Black_Checkers

        public void _002_First_Player_Cannot_Select_Black_Checkers()
        {
            var game = new Game
            {
                Board = new Board(),
                Player1 = new FakePlayer(true),
                Player2 = new FakePlayer(false),
                CheckersSet = new List<Checker>
                {
                    new Checker(true, true,   new Coordinate(2, 1)),
                    new Checker(true, false,  new Coordinate(3, 4)),
                    new Checker(false, false, new Coordinate(1, 2)),
                    new Checker(false, false, new Coordinate(2, 5)),
                    new Checker(false, false, new Coordinate(4, 5)),
                }
            };
            game.CurrentPlayer = game.Player1;

            var blackChecker = game.CheckersSet[2];
            var canSelectBlackChecker = game.CanSelectChecker(blackChecker);

            Assert.IsFalse(canSelectBlackChecker);
        }
开发者ID:kolinlob,项目名称:Checkers,代码行数:23,代码来源:PlayerTests.cs

示例3: _021_Cannot_Select_Blocked_Checker

        public void _021_Cannot_Select_Blocked_Checker()
        {
            var game = new Game
            {
                Board = new Board(),
                Player1 = new FakePlayer(true),
                Player2 = new FakePlayer(false),
                CheckersSet = new List<Checker>()
            };

            game.CurrentPlayer = game.Player1;

            game.CreateCheckers(false);
            game.CreateCheckers(true);

            var checker = game.CheckersSet.Last();

            game.FindCheckersWithTakes();

            var expected = game.CanSelectChecker(checker);
            Assert.IsFalse(expected);
        }
开发者ID:kolinlob,项目名称:Checkers,代码行数:22,代码来源:GameTests.cs

示例4: _016_Cannot_Get_Any_Checker_If_Empty_Cell_Selected

        public void _016_Cannot_Get_Any_Checker_If_Empty_Cell_Selected()
        {
            var game = new Game
            {
                Board = new Board(),
                Player1 = new FakePlayer(true),
                Player2 = new FakePlayer(false)
            };
            game.CurrentPlayer = game.Player1;

            game.CreateCheckers(false);
            game.CreateCheckers(true);

            const string validAdress = "A8";
            var adress = game.ConvertIntoCoordinates(validAdress);
            var coordinate = new Coordinate(adress.X, adress.Y);

            var checker = game.GetChecker(coordinate);
            var canSelect = game.CanSelectChecker(checker);

            Assert.IsFalse(canSelect);
        }
开发者ID:kolinlob,项目名称:Checkers,代码行数:22,代码来源:GameTests.cs

示例5: _015_Can_Get_Checker

        public void _015_Can_Get_Checker()
        {
            var game = new Game
            {
                Board = new Board(),
                Player1 = new FakePlayer(true),
                Player2 = new FakePlayer(false)
            };
            game.CurrentPlayer = game.Player2;

            game.CreateCheckers(false);
            game.CreateCheckers(true);

            game.FindCheckersWithTakes();

            var validAdress = game.CurrentPlayer.EnterCoordinates();
            var moveStartCoordinate = game.ConvertIntoCoordinates(validAdress);

            var checker = game.GetChecker(moveStartCoordinate);
            var canSelectChecker = game.CanSelectChecker(checker);

            Assert.IsTrue(canSelectChecker);
        }
开发者ID:kolinlob,项目名称:Checkers,代码行数:23,代码来源:GameTests.cs


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