#include "toggle_pause.hpp" #include #include TogglePauseCommand::TogglePauseCommand( std::shared_ptr generation_tracker, std::shared_ptr statusline ) noexcept : _generation_tracker(std::move(generation_tracker)), _statusline(std::move(statusline)) { } void TogglePauseCommand::execute() noexcept { auto onoff = !_generation_tracker->get_is_paused(); _generation_tracker->set_is_paused(onoff); _statusline->set_status( StatusLineSection::B, fmt::format( "Paused: {} Generation: {}", _generation_tracker->get_is_paused() ? "yes" : "no", _generation_tracker->get_current_generation() ) ); }