本文整理汇总了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);
}
示例2: GameDoesNotAllowColumnOver2
public void GameDoesNotAllowColumnOver2()
{
var g = new Game();
var playerType = PlayerType.X;
g.PlayTurn(playerType, 2, 3);
}
示例3: GameDoesNotAllowRowOver2
public void GameDoesNotAllowRowOver2()
{
var g = new Game();
var playerType = PlayerType.X;
g.PlayTurn(playerType, 3, 1);
}
示例4: GameDoesNotAllowColumnUnder0
public void GameDoesNotAllowColumnUnder0()
{
var g = new Game();
var playerType = PlayerType.X;
g.PlayTurn(playerType, -1, 0);
}
示例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]);
}
示例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);
}
示例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);
}
示例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);
}
示例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]);
}