本文整理汇总了C#中Field.UnmakeMove方法的典型用法代码示例。如果您正苦于以下问题:C# Field.UnmakeMove方法的具体用法?C# Field.UnmakeMove怎么用?C# Field.UnmakeMove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Field
的用法示例。
在下文中一共展示了Field.UnmakeMove方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CalculateHash_VeryLongGame
public void CalculateHash_VeryLongGame()
{
var field = new Field(39, 32);
ZobristHashField hash = new ZobristHashField(field, 0);
ulong initKey = hash.Key;
GameMove[] moves = TestUtils.LoadMovesFromPointsXt("VeryLongGame.sav");
foreach (var move in moves)
{
Assert.AreEqual(true, field.MakeMove(move.Column, move.Row));
hash.UpdateHash();
}
while (field.States.Count() != 0)
{
field.UnmakeMove();
hash.UpdateHash();
}
Assert.AreEqual(initKey, hash.Key);
}
示例2: CalculateHash_SimpleSequence
public void CalculateHash_SimpleSequence()
{
int startX = 16;
int startY = 16;
var field = new Field(39, 32);
ZobristHashField hash = new ZobristHashField(field, 0);
ulong initKey = hash.Key;
field.MakeMove(startX, startY);
hash.UpdateHash();
field.MakeMove(startX + 1, startY);
hash.UpdateHash();
field.MakeMove(startX + 1, startY + 1);
hash.UpdateHash();
field.MakeMove(startX, startY + 1);
hash.UpdateHash();
while (field.States.Count() != 0)
{
field.UnmakeMove();
hash.UpdateHash();
}
Assert.AreEqual(hash.Key, initKey);
}
示例3: CalculateHash_EmptyBase
public void CalculateHash_EmptyBase()
{
int startX = 16;
int startY = 16;
var field = new Field(39, 32);
ZobristHashField hash = new ZobristHashField(field, 0);
ulong initKey = hash.Key;
field.MakeMove(startX, startY);
hash.UpdateHash();
field.MakeMove(startX + 10, startY);
hash.UpdateHash();
field.MakeMove(startX + 1, startY + 1);
hash.UpdateHash();
field.MakeMove(startX + 10, startY + 1);
hash.UpdateHash();
field.MakeMove(startX + 2, startY + 1);
hash.UpdateHash();
field.MakeMove(startX + 10, startY + 2);
hash.UpdateHash();
field.MakeMove(startX + 3, startY);
hash.UpdateHash();
field.MakeMove(startX + 10, startY + 3);
hash.UpdateHash();
field.MakeMove(startX + 2, startY - 1);
hash.UpdateHash();
field.MakeMove(startX + 10, startY + 4);
hash.UpdateHash();
field.MakeMove(startX + 1, startY - 1);
hash.UpdateHash();
field.MakeMove(startX + 1, startY);
hash.UpdateHash();
while (field.States.Count() != 0)
{
field.UnmakeMove();
hash.UpdateHash();
}
Assert.AreEqual(initKey, hash.Key);
}
示例4: CalculateHash_EnemyBaseInBase
public void CalculateHash_EnemyBaseInBase()
{
int startX = 5;
int startY = 2;
var field = new Field(39, 32);
ZobristHashField hash = new ZobristHashField(field, 0);
ulong initKey = hash.Key;
// center.
field.MakeMove(startX + 1, startY + 3);
hash.UpdateHash();
field.MakeMove(startX, startY + 3);
hash.UpdateHash();
field.MakeMove(startX + 10, startY + 2);
hash.UpdateHash();
field.MakeMove(startX + 1, startY + 2);
hash.UpdateHash();
field.MakeMove(startX + 10, startY + 3);
hash.UpdateHash();
field.MakeMove(startX + 2, startY + 2);
hash.UpdateHash();
field.MakeMove(startX + 10, startY + 4);
hash.UpdateHash();
field.MakeMove(startX + 3, startY + 3);
hash.UpdateHash();
field.MakeMove(startX + 10, startY + 5);
hash.UpdateHash();
field.MakeMove(startX + 2, startY + 4);
hash.UpdateHash();
field.MakeMove(startX + 10, startY + 6);
hash.UpdateHash();
field.MakeMove(startX + 1, startY + 4);
hash.UpdateHash();
PutBigBase(field, hash);
ulong firstHash = hash.Key;
while (field.States.Count() != 0)
{
field.UnmakeMove();
hash.UpdateHash();
}
Assert.AreEqual(initKey, hash.Key);
startX = 16;
startY = 16;
}
示例5: CalculateHash_DifferentBaseCreationOrder
public void CalculateHash_DifferentBaseCreationOrder()
{
int startX = 16;
int startY = 16;
var field = new Field(39, 32);
ZobristHashField hash = new ZobristHashField(field, 0);
ulong initKey = hash.Key;
field.MakeMove(startX, startY);
hash.UpdateHash();
field.MakeMove(startX + 1, startY);
hash.UpdateHash();
field.MakeMove(startX + 1, startY + 1);
hash.UpdateHash();
field.MakeMove(startX + 2, startY + 1);
hash.UpdateHash();
field.MakeMove(startX + 1, startY - 1);
hash.UpdateHash();
field.MakeMove(startX + 2, startY - 1);
hash.UpdateHash();
field.MakeMove(startX + 2, startY);
hash.UpdateHash();
field.MakeMove(startX + 3, startY);
hash.UpdateHash();
field.MakeMove(startX - 2, startY);
hash.UpdateHash();
field.MakeMove(startX - 2, startY - 1);
hash.UpdateHash();
ulong firstHash = hash.Key;
while (field.States.Count() != 0)
{
field.UnmakeMove();
hash.UpdateHash();
}
Assert.AreEqual(hash.Key, initKey);
field.MakeMove(startX - 2, startY);
hash.UpdateHash();
field.MakeMove(startX + 1, startY);
hash.UpdateHash();
field.MakeMove(startX, startY);
hash.UpdateHash();
field.MakeMove(startX + 2, startY + 1);
hash.UpdateHash();
field.MakeMove(startX + 1, startY + 1);
hash.UpdateHash();
field.MakeMove(startX + 2, startY - 1);
hash.UpdateHash();
field.MakeMove(startX + 1, startY - 1);
hash.UpdateHash();
field.MakeMove(startX + 3, startY);
hash.UpdateHash();
field.MakeMove(startX + 2, startY);
hash.UpdateHash();
field.MakeMove(startX - 2, startY - 1);
hash.UpdateHash();
ulong secondHash = hash.Key;
Assert.AreEqual(firstHash, secondHash);
while (field.States.Count() != 0)
{
field.UnmakeMove();
hash.UpdateHash();
}
Assert.AreEqual(initKey, hash.Key);
}