1#ifndef EILE_MIT_WEILE_GAME_INSTANCE_MANAGER_HPP
2#define EILE_MIT_WEILE_GAME_INSTANCE_MANAGER_HPP
6#include <unordered_map>
8#include "GameInstance.hpp"
9#include "PlayerManager.hpp"
10#include "ServerNetworkManager.hpp"
30 static std::unordered_map<std::string, GameInstance*>
games_lut;
Manages all active GameInstances.
Definition GameInstanceManager.hpp:26
static bool TryAddPlayer(Player *player, GameInstance *&game_instance_ptr, std::string &err)
Definition GameInstanceManager.cpp:88
static std::unordered_map< std::string, GameInstance * > games_lut
Definition GameInstanceManager.hpp:3
static bool TryAddPlayerToAnyGame(Player *player, GameInstance *&game_instance_ptr, std::string &err)
Definition GameInstanceManager.cpp:60
static bool TryRemovePlayer(Player *player, const std::string &game_id, std::string &err)
Definition GameInstanceManager.cpp:106
static bool TryGetPlayerAndGameInstance(const std::string &player_id, Player *&player, GameInstance *&game_instance_ptr, std::string &err)
Definition GameInstanceManager.cpp:46
static GameInstance * CreateNewGame()
Definition GameInstanceManager.cpp:120
static GameInstance * FindJoinableGameInstance()
Definition GameInstanceManager.cpp:5
static std::shared_mutex games_lut_lock
Definition GameInstanceManager.hpp:29
static bool TryGetGameInstance(const std::string &game_id, GameInstance *&game_instance_ptr)
Definition GameInstanceManager.cpp:35
Contains ServerGameState and can modify it.
Definition GameInstance.hpp:22
Holds all relevant information of a player.
Definition Player.hpp:27
A serializable value, used for writing values into json.
Definition serializable_value.hpp:28