![]() |
ConnectX 3.0
ConnectX Game Suite
|
#include <game_session.hpp>
Public Member Functions | |
| GameSession (uint32_t id, uint8_t rows, uint8_t cols, uint8_t num_players, uint8_t connect_length, const std::string &name="") | |
| uint32_t | getId () const |
| const std::string & | getName () const |
| void | setName (const std::string &name) |
| GameEngine & | getEngine () |
| const GameEngine & | getEngine () const |
| uint8_t | addPlayer (uint32_t connection_id) |
| void | removePlayer (uint32_t connection_id) |
| std::optional< uint8_t > | getPlayerId (uint32_t connection_id) const |
| const std::vector< uint32_t > & | getConnections () const |
| bool | isFull () const |
| size_t | getPlayerCount () const |
| uint8_t | getMaxPlayers () const |
Represents a single game instance on the server
| GameSession::GameSession | ( | uint32_t | id, |
| uint8_t | rows, | ||
| uint8_t | cols, | ||
| uint8_t | num_players, | ||
| uint8_t | connect_length, | ||
| const std::string & | name = "" |
||
| ) |
| uint8_t GameSession::addPlayer | ( | uint32_t | connection_id | ) |
Add a player to this game
|
inline |
Get all connection IDs in this game
|
inline |
Get game engine
|
inline |
|
inline |
Get game ID
|
inline |
Get max players
|
inline |
Get game name
|
inline |
Get current player count
| std::optional< uint8_t > GameSession::getPlayerId | ( | uint32_t | connection_id | ) | const |
Get player ID for a connection
|
inline |
Check if game is full
| void GameSession::removePlayer | ( | uint32_t | connection_id | ) |
Remove a player from this game
|
inline |
Set game name