Repository class for managing the game state in the database.
More...
#include <game_state_repository.h>
|
| | GameStateRepository (std::shared_ptr< DatabaseConnection > db_conn) |
| | Construct a new Game State Repository object.
|
| |
| bool | isFirstRun () const |
| | Check if this is the first time the game is run.
|
| |
| void | updateGameState (uint8_t current_season, uint16_t managed_team_id, const std::string &game_date) const |
| | Update the current game state in the database.
|
| |
| bool | loadGameState (uint8_t ¤t_season, uint16_t &managed_team_id, std::string &game_date) const |
| | Load the game state from the database.
|
| |
Repository class for managing the game state in the database.
◆ GameStateRepository()
Construct a new Game State Repository object.
- Parameters
-
| db_conn | Shared pointer to the database connection. |
◆ isFirstRun()
| bool GameStateRepository::isFirstRun |
( |
| ) |
const |
Check if this is the first time the game is run.
- Returns
- True if it is the first run, false otherwise.
◆ loadGameState()
| bool GameStateRepository::loadGameState |
( |
uint8_t & |
current_season, |
|
|
uint16_t & |
managed_team_id, |
|
|
std::string & |
game_date |
|
) |
| const |
Load the game state from the database.
- Parameters
-
| current_season | Reference to store the current season number. |
| managed_team_id | Reference to store the managed team ID. |
| game_date | Reference to store the current game date. |
- Returns
- True if the game state was successfully loaded, false otherwise.
◆ updateGameState()
| void GameStateRepository::updateGameState |
( |
uint8_t |
current_season, |
|
|
uint16_t |
managed_team_id, |
|
|
const std::string & |
game_date |
|
) |
| const |
Update the current game state in the database.
- Parameters
-
| current_season | The current season number. |
| managed_team_id | The ID of the team managed by the player. |
| game_date | The current date in the game as a string. |
◆ db_conn
The documentation for this class was generated from the following files: