Botball Game State
A game stared library for Botball, it helps model the table and different phases of the competition.
Loading...
Searching...
No Matches
TableState.h
1#pragma once
2#include "Socket.h"
3#include "Util.h"
4using namespace Util;
5
6class TableState {
7 std::unordered_map<std::string, std::any> m_environment;
8 std::shared_ptr<spdlog::logger> m_log;
9
10public:
11 explicit TableState(const json &data);
12
18 bool has(const std::string &key) const;
19
25 void set(const std::string &key, std::any value);
26
32 void set(const std::string &key, std::any value, const Socket &so);
33
39 [[nodiscard]] std::any get(const std::string &key) const;
40
45 [[nodiscard]] std::unordered_map<std::string, std::any> getAll() const;
46
51 explicit TableState(const std::string &path);
52};
Definition Socket.h:8
void set(const std::string &key, std::any value)
std::any get(const std::string &key) const
void set(const std::string &key, std::any value, const Socket &so)
std::unordered_map< std::string, std::any > getAll() const
TableState(const std::string &path)
bool has(const std::string &key) const