private void Initialize(ILevelControllerOptions options) { // Constructs all the in-level components, then stores the ones that'll be needed later in member variables. // Done this way rather than directly initializing the member variables because this way if they're reordered, // the compiler will complain if something's being constructed before its dependency. var surface = GeodesicSphereFactory.Build(options); var simulation = new SimulationController(surface, options); var cameraController = new CameraController(options); var meshManager = new MeshManager(surface); var cursorTracker = new CursorTracker(cameraController.Camera, meshManager); var fieldManipulator = new FieldManipulator(surface, cursorTracker, options); var colorMapView = new ColorMapView(surface, meshManager.Mesh, options); var particleMapView = new ParticleMapView(surface, options); var rawValuesView = new RawValuesView(cursorTracker); var timeDilationView = new TimeView(50, options.Timestep); var latLongGridView = new LatLongGridView(options.Radius); _simulationController = simulation; _colorMapView = colorMapView; _particleMapView = particleMapView; _rawValuesView = rawValuesView; _timeView = timeDilationView; _latLongGridView = latLongGridView; _cameraController = cameraController; _cursorTracker = cursorTracker; _fieldManipulator = fieldManipulator; }
void SaveColor() { App.Core.Log("Color map editor", "Saving color..."); if (CurrentColor != null) { CurrentColor.Name = NameTextBox.Text; CurrentColor.Suffix = SuffixTextBox.Text; CurrentColor.Color = Color.FromRgb(ColorCanvas.R, ColorCanvas.G, ColorCanvas.B); ColorMapView.UpdateLayout(); ColorMapView.InvalidateVisual(); Refresh(); } App.Core.Log("Color map editor", "Saved color."); }