7#include <condition_variable>
25class GameLaunchManager
50 static GameLaunchManager&
instance();
82 GameLaunchManager(
const GameLaunchManager&) =
delete;
83 GameLaunchManager& operator=(
const GameLaunchManager&) =
delete;
89 void transitionTo(
LaunchState newState,
const std::string& message =
"");
93 bool checkAndSyncSettings();
96 bool verifyGameStarted();
102 bool interruptibleSleep(std::chrono::milliseconds duration);
108 std::atomic<LaunchState> currentState_;
109 std::atomic<bool> shouldCancel_;
111 mutable std::mutex stateMutex_;
112 std::condition_variable stateCV_;
114 std::unique_ptr<Game> currentGame_;
115 std::string currentGameId_;
120 std::thread launchThread_;
std::function< void(LaunchState oldState, LaunchState newState, const std::string &message)> StateCallback
void requestLaunch(const Game &game)
LaunchState getCurrentState() const
std::function< void(bool success, const std::string &message)> CompletionCallback
void setStateCallback(StateCallback callback)
static GameLaunchManager & instance()
void setCompletionCallback(CompletionCallback callback)
std::string getCurrentGameId() const
bool isLaunchInProgress() const
Complete representation of a game in the library.