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; }
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(); } }
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(); }
public MazeDrawerRotateDecorator(IMazeDrawer drawer, MazeRotateEnum rotate) : base(drawer) { rotateMaze = rotate; }