Player12
An open source football management simulator
Loading...
Searching...
No Matches
game_state_repository.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2// Football Management Project
3// Copyright (c) 2025 - 2026 Flavio Milinanni. All Rights Reserved.
4//
5// This file is part of the Football Management Project.
6// See the LICENSE file in the project root.
7// -----------------------------------------------------------------------------
8
9#pragma once
10
11#include <cstdint>
12#include <memory>
13#include <string>
14
16
22{
23 public:
28 explicit GameStateRepository(std::shared_ptr<DatabaseConnection> db_conn);
29
34 bool isFirstRun() const;
35
42 void updateGameState(uint8_t current_season, uint16_t managed_team_id,
43 const std::string& game_date) const;
44
52 bool loadGameState(uint8_t& current_season, uint16_t& managed_team_id,
53 std::string& game_date) const;
54
55 private:
56 std::shared_ptr<DatabaseConnection> db_conn;
57};
Repository class for managing the game state in the database.
Definition game_state_repository.h:22
std::shared_ptr< DatabaseConnection > db_conn
Definition game_state_repository.h:56
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.
Definition game_state_repository.cpp:44
bool loadGameState(uint8_t &current_season, uint16_t &managed_team_id, std::string &game_date) const
Load the game state from the database.
Definition game_state_repository.cpp:59
bool isFirstRun() const
Check if this is the first time the game is run.
Definition game_state_repository.cpp:23