private PositionEditorForm(ChessFacade chessFacade) { InitializeComponent(); m_chessFacade = chessFacade; m_graphicHandler = new BasicDesign(m_pictureBoxBoard); m_pictureBoxWhiteKing.Image = m_graphicHandler.PieceImage(Piece.WhiteKing); m_pictureBoxWhiteQueen.Image = m_graphicHandler.PieceImage(Piece.WhiteQueen); m_pictureBoxWhiteRook.Image = m_graphicHandler.PieceImage(Piece.WhiteRook); m_pictureBoxWhiteBishop.Image = m_graphicHandler.PieceImage(Piece.WhiteBishop); m_pictureBoxWhiteKnight.Image = m_graphicHandler.PieceImage(Piece.WhiteKnight); m_pictureBoxWhitePawn.Image = m_graphicHandler.PieceImage(Piece.WhitePawn); m_pictureBoxBlackKing.Image = m_graphicHandler.PieceImage(Piece.BlackKing); m_pictureBoxBlackQueen.Image = m_graphicHandler.PieceImage(Piece.BlackQueen); m_pictureBoxBlackRook.Image = m_graphicHandler.PieceImage(Piece.BlackRook); m_pictureBoxBlackBishop.Image = m_graphicHandler.PieceImage(Piece.BlackBishop); m_pictureBoxBlackKnight.Image = m_graphicHandler.PieceImage(Piece.BlackKnight); m_pictureBoxBlackPawn.Image = m_graphicHandler.PieceImage(Piece.BlackPawn); m_comboEnPassant.Items.Add(Square.None); for (Square square = Square.A4; square <= Square.H5; ++square) { m_comboEnPassant.Items.Add(square); } SetEditorPiece(Piece.None); m_positionEditor = m_chessFacade.PositionEditor; m_positionEditor.BoardChanged += HandleBoardChangedEvent; UpdateInterface(); }
public void SetupProfilingTest() { PositionEditor editor = m_chessFacade.PositionEditor; editor[Square.E2] = Piece.None; editor[Square.E4] = Piece.WhitePawn; editor[Square.E7] = Piece.None; editor[Square.E5] = Piece.BlackPawn; editor[Square.G1] = Piece.None; editor[Square.F3] = Piece.WhiteKnight; editor[Square.B8] = Piece.None; editor[Square.C6] = Piece.BlackKnight; m_chessFacade.PositionEditor = editor; ClockConfiguration clockConfig = m_chessFacade.ClockConfiguration; clockConfig.ClockType = ClockType.None; m_chessFacade.ClockConfiguration = clockConfig; EngineConfiguration engineConfig = m_chessFacade.EngineConfiguration; engineConfig.EngineAutoPlay = false; engineConfig.UseBook = false; engineConfig.MaxSearchTime = new TimeSpan(0, 5, 0); engineConfig.MaxSearchDepth = 5; m_chessFacade.EngineConfiguration = engineConfig; }