Exemple #1
0
 private bool RotateAndCheckAllDirections(PuzzlePictureBox puzzleBox)
 {
     for (var i = 0; i < (int)PuzzlePictureBox.DirectionType.Count; i++)
     {
         if (CheckIsPuzzleCorrect(puzzleBox))
         {
             return(true);
         }
         puzzleBox.RotateClockWise(1);
         RedrawUI();
     }
     return(false);
 }
Exemple #2
0
        private void InitPuzzleBox(PuzzlePictureBox puzzleBox, int x, int y, uint rotation)
        {
            Controls.Add(puzzleBox);
            puzzleBox.BringToFront();

            puzzleBox.Location    = panelImages.Location + new Size(x * puzzleSizeX, y * puzzleSizeX);
            puzzleBox.Size        = new Size(puzzleSizeX, puzzleSizeX);
            puzzleBox.SizeMode    = PictureBoxSizeMode.Zoom;
            puzzleBox.BorderStyle = BorderStyle.Fixed3D;

            puzzleBox.Cell = new Point(x, y);

            if (rotationEnabled)
            {
                puzzleBox.RotateClockWise(rotation);
            }

            puzzleBox.MouseDown += pictureBoxMouseDown;
        }