Exemplo n.º 1
0
        public void reset()
        {
            cleanPieces();
            cleanBoard();
            puzzleBoard = null;
            puzzleBoard = new PuzzleBoard(flowLayoutPanel2);
            puzzleBoard.makeBoard(9);

            if (pieces == null)
            {
                return;
            }
            if (puzzleBoard == null)
            {
                return;
            }

            List <Piece> piece = pieces.getListOfPiece();

            foreach (Piece p in piece)
            {
                flowLayoutPanel1.Controls.Add(p.getPiecePicBox());
            }

            cleanBoard();
            puzzleBoard.makeBoard(9);
        }
Exemplo n.º 2
0
 public void startGame(string gameName)
 {
     cleanPieces();
     cleanBoard();
     puzzleBoard = null;
     pieces      = null;
     puzzleBoard = new PuzzleBoard(flowLayoutPanel2);
     puzzleBoard.makeBoard(9);
     pieces = new PuzzlePieces(flowLayoutPanel1, puzzleBoard);
     pieces.takePicture(gameName);
     pieces.addImagesRandomToLayout();
 }