本文整理汇总了C#中Situation.Validate方法的典型用法代码示例。如果您正苦于以下问题:C# Situation.Validate方法的具体用法?C# Situation.Validate怎么用?C# Situation.Validate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Situation
的用法示例。
在下文中一共展示了Situation.Validate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestDoubleGetsEatenAndGetsOut
public void TestDoubleGetsEatenAndGetsOut()
{
var pos = getStartPositions();
pos[0] = pos[1] = Position.RedStart;
var sit = new Situation(pos);
var moves = sit.GetMoves(Piece.Red, 6);
sit.ApplyMove(moves[0]);
moves = sit.GetMoves(Piece.Green, 6);
sit.ApplyMove(moves[0]);
Assert.AreEqual(Piece.Green, sit.board[(int)Position.GreenStart]);
Assert.AreEqual(Piece.None, sit.board[(int)Position.GreenHome1]);
Assert.AreEqual(Piece.Green, sit.board[(int)Position.GreenHome2]);
Assert.AreEqual(Piece.Green, sit.board[(int)Position.GreenHome3]);
Assert.AreEqual(Piece.Green, sit.board[(int)Position.GreenHome4]);
Assert.IsTrue(sit.Validate());
}
示例2: TestDoubleArrivesToGoal3
public void TestDoubleArrivesToGoal3()
{
var pos = getStartPositions();
pos[0] = pos[1] = Position.Yellow6;
var sit = new Situation(pos);
var moves = sit.GetMoves(Piece.Green, 3);
sit.ApplyMove(moves[0]);
Assert.AreEqual(1, moves.Length);
Assert.AreEqual(Position.GreenGoal3, moves[0].EndPosition);
Assert.AreEqual(Piece.Green, sit.board[(int)Position.GreenGoal1]);
Assert.AreEqual(Piece.None, sit.board[(int)Position.GreenGoal2]);
Assert.AreEqual(Piece.Green, sit.board[(int)Position.GreenGoal3]);
Assert.AreEqual(Piece.None, sit.board[(int)Position.GreenGoal4]);
Assert.IsTrue(sit.Validate());
}