コード例 #1
0
ファイル: AppForm.cs プロジェクト: cintock/maze-researcher
        void DefaultSettings()
        {
            drawingSettings = new MazeDrawingSettings()
            {
                CellHeight      = 10,
                CellWidth       = 10,
                BorderColor     = Color.Black,
                BackgroundColor = Color.Azure,
                SideColor       = Color.DarkGreen
            };

            drawingAlgo = MazeDrawersEnum.StandardMazeDrawer;

            clustererAlgo = MazeClusterersEnum.MazeClustererCyclic;

            mazeRotation = MazeRotateEnum.Rotate0;
        }
コード例 #2
0
        public IMazeClusterer Create(MazeClusterersEnum clusterer)
        {
            IMazeClusterer mazeClusterer;

            switch (clusterer)
            {
            case MazeClusterersEnum.MazeClustererRecursion:
                mazeClusterer = new MazeClustererRecursion();
                break;

            case MazeClusterersEnum.MazeClustererCyclic:
                mazeClusterer = new MazeClustererCyclic();
                break;

            default:
                throw new MazeException(
                          "Не предусмотрено создание объекта поиска " +
                          "областей в лабиринте этого типа");
            }

            return(mazeClusterer);
        }
コード例 #3
0
ファイル: AppForm.cs プロジェクト: cintock/maze-researcher
        private void StartConfigurationForm(object sender, EventArgs e)
        {
            ConfigurationForm dialog = new ConfigurationForm()
            {
                Drawer          = drawingAlgo,
                DrawingSettings = drawingSettings,
                Clusterer       = clustererAlgo,
                DebugLogging    = IsDebugConsoleEnabled(),
                Rotation        = mazeRotation
            };

            if (dialog.ShowDialog(this) == DialogResult.OK)
            {
                drawingAlgo   = dialog.Drawer;
                clustererAlgo = dialog.Clusterer;
                mazeRotation  = dialog.Rotation;
                SetDebugConsoleState(dialog.DebugLogging);

                ClearClusters();
                ShowMaze();
            }
        }
コード例 #4
0
        private void OKButtonClick(Object sender, EventArgs e)
        {
            int drawerIndex = drawingAlgoCombobox.SelectedIndex;

            if (drawerIndex >= 0)
            {
                drawer = drawersComboboxValues.ValueByIndex(drawerIndex);
            }

            int clustererIndex = clustererCombobox.SelectedIndex;

            if (clustererIndex >= 0)
            {
                clusterer = clustererComboboxValues.ValueByIndex(clustererIndex);
            }

            int rotationIndex = rotationCombobox.SelectedIndex;

            if (rotationIndex >= 0)
            {
                rotation = rotationComboboxValues.ValueByIndex(rotationIndex);
            }

            drawingSettings.CellHeight = (int)cellHeightNumericUpDown.Value;
            drawingSettings.CellWidth  = (int)cellWidthNumericUpDown.Value;

            drawingSettings.BackgroundColor = backgroundColor;
            drawingSettings.BorderColor     = borderColor;
            drawingSettings.SideColor       = sideColor;

            debugLogging = debugLoggingCheckbox.Checked;

            DialogResult = DialogResult.OK;

            Close();
        }