route the win-path restart through ResetCommand
This commit is contained in:
@@ -419,10 +419,12 @@ void MainWindow::handleEvent(std::shared_ptr<const WinEvent> /*event*/)
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Unlike the other two restart paths this one resets the simulation
|
// Restart is a command boundary; the view resets when the drain applies it.
|
||||||
// directly instead of enqueueing a ResetCommand; kept as-is.
|
std::shared_ptr<ResetCommand> command = std::make_shared<ResetCommand>();
|
||||||
m_sim->reset(std::move(*newConfig));
|
command->config = std::make_shared<GameConfig>(std::move(*newConfig));
|
||||||
m_gameWorldView->resetForNewGame();
|
command->seed = std::random_device{}();
|
||||||
|
EventManager::getInstance()->sendEventImmediately(
|
||||||
|
std::make_shared<CommandRequestedEvent>(command));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user