Esempio n. 1
0
        private void Step(int stepCount)
        {
            if (stepCount == 0)
            {
                return;
            }

            UIGameBoard.SuspendLayout();
            UIGameBoard.TurnOffHighlighting();
            int increment = (stepCount > 0) ? -1 : 1;

            while (stepCount != 0)
            {
                stepCount += increment;
                if (increment < 0)  // moving forward
                {
                    PuzzleSolution[CurrentStep++].Apply();
                }
                else
                {
                    PuzzleSolution[--CurrentStep].Undo();
                }
            }

            UpdateRuleButtons();
            UIGameBoard.ResumeLayout();
            UIGameBoard.Invalidate(true /*invalidateChildren*/);
            UIGameBoard.Update();
        }
Esempio n. 2
0
        private void ButtonEditGame_Click(object sender, EventArgs e)
        {
            if (PuzzleSolution != null && CurrentStep > 0)
            {
                ButtonUndoAll_Click(null, null);
            }

            UIGameBoard.TurnOffHighlighting();
            UIGameBoard.Board.EditMode = true;
            ButtonEditGame.Visible     = false;
            ButtonSolve.Visible        = false;
            ButtonEndEdit.Visible      = true;
            UIGameBoard.Invalidate(true /*invalidateChildren*/);
            UIGameBoard.Update();
        }