本文整理汇总了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);
}
示例2: OnBoardSpaceClick
public static void OnBoardSpaceClick(User user, Game game, Coord coordClicked)
{
if (GameValidator.IsValidMoveFor(user, game, coordClicked))
{
game.AddActiveMove(coordClicked);
}
}
示例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));
}
示例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)));
}
示例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));
}
示例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));
}
示例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);
}
示例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);
}
示例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)));
}