MCPcopy Create free account
hub / github.com/chrxh/alien / onNewSimulation

Method onNewSimulation

source/Gui/NewSimulationDialog.cpp:70–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70void NewSimulationDialog::onNewSimulation()
71{
72 SimulationParameters parameters;
73 if (_adoptSimulationParameters) {
74 parameters = _simulationFacade->getSimulationParameters();
75 }
76 for (int i = 0; i < ProjectNameSize; ++i) {
77 parameters.projectName[i] = _projectName[i];
78 }
79 _simulationFacade->closeSimulation();
80
81 GeneralSettings generalSettings;
82 generalSettings.worldSizeX = _width;
83 generalSettings.worldSizeY = _height;
84 _simulationFacade->newSimulation(0, generalSettings, parameters);
85 Viewport::get().setCenterInWorldPos({toFloat(_width) / 2, toFloat(_height) / 2});
86 Viewport::get().setZoomFactor(4.0f);
87 TemporalControlWindow::get().onSnapshot();
88}

Callers

nothing calls this directly

Calls 7

toFloatFunction · 0.85
closeSimulationMethod · 0.80
setCenterInWorldPosMethod · 0.80
setZoomFactorMethod · 0.80
onSnapshotMethod · 0.80
newSimulationMethod · 0.45

Tested by

no test coverage detected