public void cleanBoard() { if (puzzleBoard == null) { return; } if (puzzleBoard.getListOfParts() == null) { return; } List <Piece> parts = puzzleBoard.getListOfParts(); foreach (Piece part in parts) { flowLayoutPanel2.Controls.Remove(part.getPiecePicBox()); } }
//cheking if PictureBox exist on board public bool chekOnBoard(PictureBox chekingPicBox) { List <Piece> boardParts = board.getListOfParts(); foreach (Piece boardPiece in boardParts) { if (chekingPicBox.Image == boardPiece.getPiecePicBox().Image) { return(true); } } return(false); }