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


C# Game.AddActiveMove方法代码示例

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


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

示例1: ExecuteMoves_Capture_MovesPieceAwayFromStart

        public void ExecuteMoves_Capture_MovesPieceAwayFromStart()
        {
            Game game = new Game();
            game.SetPieceLocation(Coord.Create(0, 0), BoardSpaceState.FriendlyPieceShort);
            game.SetPieceLocation(Coord.Create(0, 1), BoardSpaceState.OpponentPieceShort);
            game.AddActiveMove(Coord.Create(0, 0));
            game.AddActiveMove(Coord.Create(0, 2));

            GameController.ExecuteMoves(game);

            Assert.AreEqual(game.GetPieceAt(Coord.Create(0, 0)), BoardSpaceState.None);
        }
开发者ID:NickHeiner,项目名称:chivalry,代码行数:12,代码来源:TestGameValidator.cs

示例2: OnBoardSpaceClick

 public static void OnBoardSpaceClick(User user, Game game, Coord coordClicked)
 {
     if (GameValidator.IsValidMoveFor(user, game, coordClicked))
     {
         game.AddActiveMove(coordClicked);
     }
 }
开发者ID:NickHeiner,项目名称:chivalry,代码行数:7,代码来源:GameController.cs

示例3: ExecuteMoves_Capture_RemovesCapturedPiece

        public void ExecuteMoves_Capture_RemovesCapturedPiece()
        {
            Game game = new Game();
            game.SetPieceLocation(Coord.Create(0, 0), BoardSpaceState.FriendlyPieceShort);
            game.SetPieceLocation(Coord.Create(0, 1), BoardSpaceState.OpponentPieceShort);
            game.AddActiveMove(Coord.Create(0, 0));
            game.AddActiveMove(Coord.Create(0, 2));

            GameController.ExecuteMoves(game);

            Assert.AreEqual(BoardSpaceState.None, game.GetPieceAt(Coord.Create(0, 1)));
            Assert.AreEqual(1, game.GetCapturedCount(BoardSpaceState.OpponentPieceShort));
        }
开发者ID:NickHeiner,项目名称:chivalry,代码行数:13,代码来源:TestGameValidator.cs

示例4: Winner_DisablesMoving

        public void Winner_DisablesMoving()
        {
            Game game = new Game();
            game.SetPieceLocation(Coord.Create(Game.BOARD_ROW_MAX, Game.ENDZONE_COL_1), BoardSpaceState.OpponentPieceShort);
            game.SetPieceLocation(Coord.Create(Game.BOARD_ROW_MAX, Game.ENDZONE_COL_2), BoardSpaceState.OpponentPieceTall);
            game.SetPieceLocation(Coord.Create(4, 5), BoardSpaceState.OpponentPieceTall);

            game.AddActiveMove(Coord.Create(4, 5));

            Assert.IsFalse(GameValidator.IsValidMove(game, Coord.Create(4, 6)));
        }
开发者ID:NickHeiner,项目名称:chivalry,代码行数:11,代码来源:TestGameValidator.cs

示例5: IsCompleteCapture_True

        public void IsCompleteCapture_True()
        {
            Game game = new Game();
            game.AddActiveMove(Coord.Create(0, 2));
            game.SetPieceLocation(Coord.Create(0, 3), BoardSpaceState.OpponentPieceShort);
            game.AddActiveMove(Coord.Create(0, 4));
            game.SetPieceLocation(Coord.Create(0, 5), BoardSpaceState.OpponentPieceShort);
            game.AddActiveMove(Coord.Create(0, 6));

            Assert.IsTrue(GameValidator.IsCompleteMove(game));
        }
开发者ID:NickHeiner,项目名称:chivalry,代码行数:11,代码来源:TestGameValidator.cs

示例6: IsCompleteCapture_SimpleMove

        public void IsCompleteCapture_SimpleMove()
        {
            Game game = new Game();
            game.AddActiveMove(Coord.Create(0, 12));
            game.AddActiveMove(Coord.Create(0, 13));

            Assert.IsTrue(GameValidator.IsCompleteMove(game));
        }
开发者ID:NickHeiner,项目名称:chivalry,代码行数:8,代码来源:TestGameValidator.cs

示例7: GameController_MakingMoveSwitchesWaitingOn

        public void GameController_MakingMoveSwitchesWaitingOn()
        {
            var game = new Game() { WaitingOn = AbsolutePlayer.Recepient };
            game.AddActiveMove(Coord.Create(0, 0));
            game.AddActiveMove(Coord.Create(0, 1));

            GameController.ExecuteMoves(game);

            Assert.AreEqual(AbsolutePlayer.Initiator, game.WaitingOn);
        }
开发者ID:NickHeiner,项目名称:chivalry,代码行数:10,代码来源:TestGameValidator.cs

示例8: ExecuteMoves_SetWinner_Friendly

        public void ExecuteMoves_SetWinner_Friendly()
        {
            Game game = new Game();
            // is this the right row?
            game.SetPieceLocation(Coord.Create(0, Game.ENDZONE_COL_1), BoardSpaceState.FriendlyPieceShort);
            game.SetPieceLocation(Coord.Create(1, Game.ENDZONE_COL_2), BoardSpaceState.FriendlyPieceShort);

            game.AddActiveMove(Coord.Create(1, Game.ENDZONE_COL_2));
            game.AddActiveMove(Coord.Create(0, Game.ENDZONE_COL_2));

            GameController.ExecuteMoves(game);

            Assert.AreEqual(RelativePlayer.Friendly, game.Winner);
        }
开发者ID:NickHeiner,项目名称:chivalry,代码行数:14,代码来源:TestGameValidator.cs

示例9: ExecuteMoves_HandleSingleMove

        public void ExecuteMoves_HandleSingleMove()
        {
            Game game = new Game();
            game.SetPieceLocation(Coord.Create(0, 10), BoardSpaceState.FriendlyPieceShort);
            game.AddActiveMove(Coord.Create(0, 10));
            game.AddActiveMove(Coord.Create(0, 11));

            GameController.ExecuteMoves(game);

            Assert.AreEqual(BoardSpaceState.None, game.GetPieceAt(Coord.Create(0, 10)));
            Assert.AreEqual(BoardSpaceState.FriendlyPieceShort, game.GetPieceAt(Coord.Create(0, 11)));
        }
开发者ID:NickHeiner,项目名称:chivalry,代码行数:12,代码来源:TestGameValidator.cs


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