本文整理汇总了C#中ChessGame.GetBoard方法的典型用法代码示例。如果您正苦于以下问题:C# ChessGame.GetBoard方法的具体用法?C# ChessGame.GetBoard怎么用?C# ChessGame.GetBoard使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ChessGame
的用法示例。
在下文中一共展示了ChessGame.GetBoard方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestArrayGetting
public static void TestArrayGetting()
{
ChessGame cb = new ChessGame();
int one = (int)Rank.One;
int two = (int)Rank.Two;
int three = (int)Rank.Three;
int four = (int)Rank.Four;
int five = (int)Rank.Five;
int six = (int)Rank.Six;
int seven = (int)Rank.Seven;
int eight = (int)Rank.Eight;
int a = (int)File.A;
int b = (int)File.B;
int c = (int)File.C;
int d = (int)File.D;
int e = (int)File.E;
int f = (int)File.F;
int g = (int)File.G;
int h = (int)File.H;
Assert.AreEqual(rw, cb.GetBoard()[one][a]);
Assert.AreEqual(nw, cb.GetBoard()[one][b]);
Assert.AreEqual(bw, cb.GetBoard()[one][c]);
Assert.AreEqual(qw, cb.GetBoard()[one][d]);
Assert.AreEqual(kw, cb.GetBoard()[one][e]);
Assert.AreEqual(bw, cb.GetBoard()[one][f]);
Assert.AreEqual(nw, cb.GetBoard()[one][g]);
Assert.AreEqual(rw, cb.GetBoard()[one][h]);
Assert.AreEqual(pw, cb.GetBoard()[two][a]);
Assert.AreEqual(pw, cb.GetBoard()[two][b]);
Assert.AreEqual(pw, cb.GetBoard()[two][c]);
Assert.AreEqual(pw, cb.GetBoard()[two][d]);
Assert.AreEqual(pw, cb.GetBoard()[two][e]);
Assert.AreEqual(pw, cb.GetBoard()[two][f]);
Assert.AreEqual(pw, cb.GetBoard()[two][g]);
Assert.AreEqual(pw, cb.GetBoard()[two][h]);
Assert.AreEqual(o, cb.GetBoard()[three][a]);
Assert.AreEqual(o, cb.GetBoard()[three][b]);
Assert.AreEqual(o, cb.GetBoard()[three][c]);
Assert.AreEqual(o, cb.GetBoard()[three][d]);
Assert.AreEqual(o, cb.GetBoard()[three][e]);
Assert.AreEqual(o, cb.GetBoard()[three][f]);
Assert.AreEqual(o, cb.GetBoard()[three][g]);
Assert.AreEqual(o, cb.GetBoard()[three][h]);
Assert.AreEqual(o, cb.GetBoard()[four][a]);
Assert.AreEqual(o, cb.GetBoard()[four][b]);
Assert.AreEqual(o, cb.GetBoard()[four][c]);
Assert.AreEqual(o, cb.GetBoard()[four][d]);
Assert.AreEqual(o, cb.GetBoard()[four][e]);
Assert.AreEqual(o, cb.GetBoard()[four][f]);
Assert.AreEqual(o, cb.GetBoard()[four][g]);
Assert.AreEqual(o, cb.GetBoard()[four][h]);
Assert.AreEqual(o, cb.GetBoard()[five][a]);
Assert.AreEqual(o, cb.GetBoard()[five][b]);
Assert.AreEqual(o, cb.GetBoard()[five][c]);
Assert.AreEqual(o, cb.GetBoard()[five][d]);
Assert.AreEqual(o, cb.GetBoard()[five][e]);
Assert.AreEqual(o, cb.GetBoard()[five][f]);
Assert.AreEqual(o, cb.GetBoard()[five][g]);
Assert.AreEqual(o, cb.GetBoard()[five][h]);
Assert.AreEqual(o, cb.GetBoard()[six][a]);
Assert.AreEqual(o, cb.GetBoard()[six][b]);
Assert.AreEqual(o, cb.GetBoard()[six][c]);
Assert.AreEqual(o, cb.GetBoard()[six][d]);
Assert.AreEqual(o, cb.GetBoard()[six][e]);
Assert.AreEqual(o, cb.GetBoard()[six][f]);
Assert.AreEqual(o, cb.GetBoard()[six][g]);
Assert.AreEqual(o, cb.GetBoard()[six][h]);
Assert.AreEqual(pb, cb.GetBoard()[seven][a]);
Assert.AreEqual(pb, cb.GetBoard()[seven][b]);
Assert.AreEqual(pb, cb.GetBoard()[seven][c]);
Assert.AreEqual(pb, cb.GetBoard()[seven][d]);
Assert.AreEqual(pb, cb.GetBoard()[seven][e]);
Assert.AreEqual(pb, cb.GetBoard()[seven][f]);
Assert.AreEqual(pb, cb.GetBoard()[seven][g]);
Assert.AreEqual(pb, cb.GetBoard()[seven][h]);
Assert.AreEqual(rb, cb.GetBoard()[eight][a]);
Assert.AreEqual(nb, cb.GetBoard()[eight][b]);
Assert.AreEqual(bb, cb.GetBoard()[eight][c]);
Assert.AreEqual(qb, cb.GetBoard()[eight][d]);
Assert.AreEqual(kb, cb.GetBoard()[eight][e]);
Assert.AreEqual(bb, cb.GetBoard()[eight][f]);
Assert.AreEqual(nb, cb.GetBoard()[eight][g]);
Assert.AreEqual(rb, cb.GetBoard()[eight][h]);
}
示例2: TestApplyMoveWhiteKing_KingsideCastling
public static void TestApplyMoveWhiteKing_KingsideCastling()
{
ChessPiece[][] board = new ChessPiece[8][]
{
new[] { o, o, o, o, kb, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, kw, o, o, rw }
};
Move move = new Move(new Position(File.E, Rank.One), new Position(File.G, Rank.One), Player.White);
ChessGame cb = new ChessGame(board, Player.White);
cb.ApplyMove(move, true);
ChessPiece[][] expected = new ChessPiece[8][]
{
new[] { o, o, o, o, kb, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, rw, kw, o }
};
Assert.AreEqual(expected, cb.GetBoard());
}
示例3: TestApplyMoveBlackKing_QueensideCastling
public static void TestApplyMoveBlackKing_QueensideCastling()
{
ChessPiece[][] board = new ChessPiece[8][]
{
new[] { rb, o, o, o, kb, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, kw, o, o, o }
};
Move move = new Move(new Position(File.E, Rank.Eight), new Position(File.C, Rank.Eight), Player.Black);
ChessGame cb = new ChessGame(board, Player.Black);
cb.ApplyMove(move, true);
ChessPiece[][] expected = new ChessPiece[8][]
{
new[] { o, o, kb, rb, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, kw, o, o, o }
};
Assert.AreEqual(expected, cb.GetBoard());
}
示例4: TestApplyMoveBlackPawn_PromotionToQueen
public static void TestApplyMoveBlackPawn_PromotionToQueen()
{
ChessPiece[][] board = new ChessPiece[8][]
{
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, kw, o, kb, pb, o },
new[] { o, o, o, o, o, o, o, o }
};
Move move = new Move(new Position(File.G, Rank.Two), new Position(File.G, Rank.One), Player.Black, Piece.Queen);
ChessGame cb = new ChessGame(board, Player.Black);
Assert.True(cb.ApplyMove(move, false), "move should be valid");
ChessPiece[][] expected = new ChessPiece[8][]
{
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, kw, o, kb, o, o },
new[] { o, o, o, o, o, o, qb, o }
};
Assert.AreEqual(expected, cb.GetBoard());
}
示例5: TestApplyMoveBlackPawn_EnPassant
public static void TestApplyMoveBlackPawn_EnPassant()
{
ChessGame cb = new ChessGame();
Move move1 = new Move(new Position(File.B, Rank.One), new Position(File.A, Rank.Three), Player.White);
Move move2 = new Move(new Position(File.E, Rank.Seven), new Position(File.E, Rank.Five), Player.Black);
Move move3 = new Move(new Position(File.E, Rank.Two), new Position(File.E, Rank.Three), Player.White);
Move move4 = new Move(new Position(File.E, Rank.Five), new Position(File.E, Rank.Four), Player.Black);
Move move5 = new Move(new Position(File.D, Rank.Two), new Position(File.D, Rank.Four), Player.White);
Move move6 = new Move(new Position(File.E, Rank.Four), new Position(File.D, Rank.Three), Player.Black);
cb.ApplyMove(move1, true);
cb.ApplyMove(move2, true);
cb.ApplyMove(move3, true);
cb.ApplyMove(move4, true);
cb.ApplyMove(move5, true);
cb.ApplyMove(move6, true);
ChessPiece[][] board = new ChessPiece[8][]
{
new[] { rb, nb, bb, qb, kb, bb, nb, rb },
new[] { pb, pb, pb, pb, o, pb, pb, pb },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { nw, o, o, pb, pw, o, o, o },
new[] { pw, pw, pw, o, o, pw, pw, pw },
new[] { rw, o, bw, qw, kw, bw, nw, rw }
};
Assert.AreEqual(board, cb.GetBoard(), "Unexpected board layout after en passant capture.");
}
示例6: TestApplyMoveWhitePawn
public static void TestApplyMoveWhitePawn()
{
ChessGame cb = new ChessGame();
Move move1 = new Move(new Position(File.E, Rank.Two), new Position(File.E, Rank.Three), Player.White);
Assert.True(cb.ApplyMove(move1, false));
ChessPiece[][] expected = new ChessPiece[8][]
{
new[] { rb, nb, bb, qb, kb, bb, nb, rb },
new[] { pb, pb, pb, pb, pb, pb, pb, pb },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, pw, o, o, o },
new[] { pw, pw, pw, pw, o, pw, pw, pw },
new[] { rw, nw, bw, qw, kw, bw, nw, rw }
};
Assert.AreEqual(expected, cb.GetBoard(), "Unexpected board layout after applying move1");
Move move2 = new Move(new Position(File.E, Rank.Three), new Position(File.E, Rank.Four), Player.White);
Assert.True(cb.ApplyMove(move2, true));
expected = new ChessPiece[8][]
{
new[] { rb, nb, bb, qb, kb, bb, nb, rb },
new[] { pb, pb, pb, pb, pb, pb, pb, pb },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, pw, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { pw, pw, pw, pw, o, pw, pw, pw },
new[] { rw, nw, bw, qw, kw, bw, nw, rw }
};
Assert.AreEqual(expected, cb.GetBoard(), "Unexpected board layout after applying move2");
}
示例7: TestApplyMoveWhitePawn_PromotionToQueen
public static void TestApplyMoveWhitePawn_PromotionToQueen()
{
ChessPiece[][] board = new ChessPiece[8][]
{
new[] { o, o, o, o, o, o, o, o },
new[] { pw, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, kw, o, kb, o, o },
new[] { o, o, o, o, o, o, o, o }
};
Move move = new Move(new Position(File.A, Rank.Seven), new Position(File.A, Rank.Eight), Player.White, Piece.Queen);
ChessGame cb = new ChessGame(board, Player.White);
Assert.True(cb.ApplyMove(move, false), "move should be valid");
ChessPiece[][] expected = new ChessPiece[8][]
{
new[] { qw, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, kw, o, kb, o, o },
new[] { o, o, o, o, o, o, o, o }
};
Assert.AreEqual(expected, cb.GetBoard());
}
示例8: TestApplyMoveBlackPawn_PromotionToQueen
public static void TestApplyMoveBlackPawn_PromotionToQueen()
{
Piece[][] board = new Piece[8][]
{
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, kw, o, kb, pb, o },
new[] { o, o, o, o, o, o, o, o }
};
Move move = new Move(new Position(File.G, 2), new Position(File.G, 1), Player.Black, 'Q');
ChessGame cb = new ChessGame(board, Player.Black);
Assert.AreNotEqual(cb.ApplyMove(move, false), MoveType.Invalid, "move should be valid");
Piece[][] expected = new Piece[8][]
{
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, kw, o, kb, o, o },
new[] { o, o, o, o, o, o, qb, o }
};
Assert.AreEqual(expected, cb.GetBoard());
}
示例9: TestArrayGetting
public static void TestArrayGetting()
{
ChessGame cb = new ChessGame();
int a = (int)File.A;
int b = (int)File.B;
int c = (int)File.C;
int d = (int)File.D;
int e = (int)File.E;
int f = (int)File.F;
int g = (int)File.G;
int h = (int)File.H;
Piece[][] board = cb.GetBoard();
Assert.AreEqual(rw, board[7][a]);
Assert.AreEqual(nw, board[7][b]);
Assert.AreEqual(bw, board[7][c]);
Assert.AreEqual(qw, board[7][d]);
Assert.AreEqual(kw, board[7][e]);
Assert.AreEqual(bw, board[7][f]);
Assert.AreEqual(nw, board[7][g]);
Assert.AreEqual(rw, board[7][h]);
Assert.AreEqual(pw, board[6][a]);
Assert.AreEqual(pw, board[6][b]);
Assert.AreEqual(pw, board[6][c]);
Assert.AreEqual(pw, board[6][d]);
Assert.AreEqual(pw, board[6][e]);
Assert.AreEqual(pw, board[6][f]);
Assert.AreEqual(pw, board[6][g]);
Assert.AreEqual(pw, board[6][h]);
Assert.AreEqual(o, board[5][a]);
Assert.AreEqual(o, board[5][b]);
Assert.AreEqual(o, board[5][c]);
Assert.AreEqual(o, board[5][d]);
Assert.AreEqual(o, board[5][e]);
Assert.AreEqual(o, board[5][f]);
Assert.AreEqual(o, board[5][g]);
Assert.AreEqual(o, board[5][h]);
Assert.AreEqual(o, board[4][a]);
Assert.AreEqual(o, board[4][b]);
Assert.AreEqual(o, board[4][c]);
Assert.AreEqual(o, board[4][d]);
Assert.AreEqual(o, board[4][e]);
Assert.AreEqual(o, board[4][f]);
Assert.AreEqual(o, board[4][g]);
Assert.AreEqual(o, board[4][h]);
Assert.AreEqual(o, board[3][a]);
Assert.AreEqual(o, board[3][b]);
Assert.AreEqual(o, board[3][c]);
Assert.AreEqual(o, board[3][d]);
Assert.AreEqual(o, board[3][e]);
Assert.AreEqual(o, board[3][f]);
Assert.AreEqual(o, board[3][g]);
Assert.AreEqual(o, board[3][h]);
Assert.AreEqual(o, board[2][a]);
Assert.AreEqual(o, board[2][b]);
Assert.AreEqual(o, board[2][c]);
Assert.AreEqual(o, board[2][d]);
Assert.AreEqual(o, board[2][e]);
Assert.AreEqual(o, board[2][f]);
Assert.AreEqual(o, board[2][g]);
Assert.AreEqual(o, board[2][h]);
Assert.AreEqual(pb, board[1][a]);
Assert.AreEqual(pb, board[1][b]);
Assert.AreEqual(pb, board[1][c]);
Assert.AreEqual(pb, board[1][d]);
Assert.AreEqual(pb, board[1][e]);
Assert.AreEqual(pb, board[1][f]);
Assert.AreEqual(pb, board[1][g]);
Assert.AreEqual(pb, board[1][h]);
Assert.AreEqual(rb, board[0][a]);
Assert.AreEqual(nb, board[0][b]);
Assert.AreEqual(bb, board[0][c]);
Assert.AreEqual(qb, board[0][d]);
Assert.AreEqual(kb, board[0][e]);
Assert.AreEqual(bb, board[0][f]);
Assert.AreEqual(nb, board[0][g]);
Assert.AreEqual(rb, board[0][h]);
}
示例10: TestApplyMoveWhitePawn_EnPassant
public static void TestApplyMoveWhitePawn_EnPassant()
{
ChessGame cb = new ChessGame();
Move move1 = new Move(new Position(File.E, 2), new Position(File.E, 4), Player.White);
Move move2 = new Move(new Position(File.E, 7), new Position(File.E, 6), Player.Black);
Move move3 = new Move(new Position(File.E, 4), new Position(File.E, 5), Player.White);
Move move4 = new Move(new Position(File.D, 7), new Position(File.D, 5), Player.Black);
Move move5 = new Move(new Position(File.E, 5), new Position(File.D, 6), Player.White);
cb.ApplyMove(move1, true);
cb.ApplyMove(move2, true);
cb.ApplyMove(move3, true);
cb.ApplyMove(move4, true);
cb.ApplyMove(move5, true);
Piece[][] board = new Piece[8][]
{
new[] { rb, nb, bb, qb, kb, bb, nb, rb },
new[] { pb, pb, pb, o, o, pb, pb, pb },
new[] { o, o, o, pw, pb, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { pw, pw, pw, pw, o, pw, pw, pw },
new[] { rw, nw, bw, qw, kw, bw, nw, rw }
};
Assert.AreEqual(board, cb.GetBoard(), "Unexpected board layout after en passant capture.");
}
示例11: TestChessGameFenConstructorAfter1e4c5
public static void TestChessGameFenConstructorAfter1e4c5()
{
ChessGame game = new ChessGame("rnbqkbnr/pp1ppppp/8/2p5/4P3/8/PPPP1PPP/RNBQKBNR w KQkq c6 0 2");
Piece[][] expected = new Piece[8][]
{
new[] { rb, nb, bb, qb, kb, bb, nb, rb },
new[] { pb, pb, o, pb, pb, pb, pb, pb },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, pb, o, o, o, o, o },
new[] { o, o, o, o, pw, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { pw, pw, pw, pw, o, pw, pw, pw },
new[] { rw, nw, bw, qw, kw, bw, nw, rw }
};
Assert.AreEqual(expected, game.GetBoard());
Assert.AreEqual(0, game.HalfMoveClock);
Assert.AreEqual(2, game.FullMoveNumber);
Assert.AreEqual(Player.White, game.WhoseTurn);
Assert.AreEqual(new Position("C7"), game.Moves[game.Moves.Count - 1].OriginalPosition);
Assert.AreEqual(new Position("C5"), game.Moves[game.Moves.Count - 1].NewPosition);
Assert.AreEqual(Player.Black, game.Moves[game.Moves.Count - 1].Player);
}
示例12: TestChessGameFenConstructorNoCastlingRights
public static void TestChessGameFenConstructorNoCastlingRights()
{
ChessGame game = new ChessGame("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w - - 16 9");
Piece[][] expected = new Piece[8][]
{
new[] { rb, nb, bb, qb, kb, bb, nb, rb },
new[] { pb, pb, pb, pb, pb, pb, pb, pb },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { pw, pw, pw, pw, pw, pw, pw, pw },
new[] { rw, nw, bw, qw, kw, bw, nw, rw }
};
Assert.AreEqual(expected, game.GetBoard());
Assert.AreEqual(16, game.HalfMoveClock);
Assert.AreEqual(9, game.FullMoveNumber);
Assert.AreEqual(Player.White, game.WhoseTurn);
Assert.False(game.CanBlackCastleKingSide);
Assert.False(game.CanBlackCastleQueenSide);
Assert.False(game.CanWhiteCastleKingSide);
Assert.False(game.CanWhiteCastleQueenSide);
}
示例13: TestChessGameFenConstructorPartialCastlingRights
public static void TestChessGameFenConstructorPartialCastlingRights()
{
ChessGame game = new ChessGame("rnbqkbn1/pppppppr/7p/8/4P3/5N2/PPPP1PPP/RNBQKB1R w KQq - 2 3");
Piece[][] expected = new Piece[8][]
{
new[] { rb, nb, bb, qb, kb, bb, nb, o },
new[] { pb, pb, pb, pb, pb, pb, pb, rb },
new[] { o, o, o, o, o, o, o, pb },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, pw, o, o, o },
new[] { o, o, o, o, o, nw, o, o },
new[] { pw, pw, pw, pw, o, pw, pw, pw },
new[] { rw, nw, bw, qw, kw, bw, o, rw }
};
Assert.AreEqual(expected, game.GetBoard());
Assert.AreEqual(2, game.HalfMoveClock);
Assert.AreEqual(3, game.FullMoveNumber);
Assert.False(game.CanBlackCastleKingSide);
}
示例14: TestChessGameFenConstructorAfter1e3
public static void TestChessGameFenConstructorAfter1e3()
{
ChessGame game = new ChessGame("rnbqkbnr/pppppppp/8/8/8/4P3/PPPP1PPP/RNBQKBNR w KQkq - 0 1");
Piece[][] expected = new Piece[8][]
{
new[] { rb, nb, bb, qb, kb, bb, nb, rb },
new[] { pb, pb, pb, pb, pb, pb, pb, pb },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, o, o, o, o },
new[] { o, o, o, o, pw, o, o, o },
new[] { pw, pw, pw, pw, o, pw, pw, pw },
new[] { rw, nw, bw, qw, kw, bw, nw, rw }
};
Assert.AreEqual(expected, game.GetBoard());
Assert.AreEqual(0, game.HalfMoveClock);
Assert.AreEqual(1, game.FullMoveNumber);
Assert.AreEqual(0, game.Moves.Count);
}