Botball Game State
A game stared library for Botball, it helps model the table and different phases of the competition.
Loading...
Searching...
No Matches
Server.h
1#pragma once
2#include <string>
3
4#include "GameState.h"
5#include "PhaseState.h"
6#include <Socket.h>
7
8class Server : public Socket {
9 Config m_cfg = {};
10 std::unique_ptr<PhaseState> m_phase_state;
11 std::unique_ptr<TableState> m_table_state;
12 json m_table_data;
13 json m_phase_data;
14 json m_config_data;
15 std::shared_ptr<spdlog::logger> m_log = create_logger("SERVER");
16
17public:
24 void init(const std::string &table_config_path, const std::string &phase_config_path,
25 const std::string &game_state_config_path);
26
31 void validate_phase(const Phase &phase) const;
32
36 [[nodiscard]] json generate_response() const;
37
42 [[nodiscard]] GameState serve(int port);
43};
Definition GameState.h:35
Definition Phase.h:51
Definition Server.h:8
json generate_response() const
GameState serve(int port)
void init(const std::string &table_config_path, const std::string &phase_config_path, const std::string &game_state_config_path)
void validate_phase(const Phase &phase) const
Definition Socket.h:8
Definition GameState.h:12