private void UndoPlayMove(King king, Cell currentCell, Cell kingCoords, Piece piece) { var moveOne = MoveNotationConverter.TransformIntoMoveInstance(piece, currentCell); board.AddPiece(moveOne.Coordinate, piece); var moveTwo = MoveNotationConverter.TransformIntoMoveInstance(king, kingCoords); board.AddPiece(moveTwo.Coordinate, king); board.whitePieces.Add(piece); }
internal bool VerifyIfKingIsInCheck(Cell currentCell) { var isPiece = false; foreach (var item in board.whitePieces) { Move move = MoveNotationConverter.TransformIntoMoveInstance(item, currentCell); if (item.Name == PieceName.Pawn) { move.IsCapture = true; } isPiece = board.FindPieceWhoNeedsToBeMoved(move); } return(isPiece); }