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 Class Reference

Public Member Functions

 TableState (const json &data)
bool has (const std::string &key) const
void set (const std::string &key, std::any value)
void set (const std::string &key, std::any value, const Socket &so)
std::any get (const std::string &key) const
std::unordered_map< std::string, std::any > getAll () const
 TableState (const std::string &path)

Constructor & Destructor Documentation

◆ TableState()

TableState::TableState ( const std::string & path)
explicit
Parameters
path

Member Function Documentation

◆ get()

std::any TableState::get ( const std::string & key) const
nodiscard

Gets a value from the table state

Parameters
keyrequired to access the value
Returns
the value belonging to the key

◆ getAll()

std::unordered_map< std::string, std::any > TableState::getAll ( ) const
nodiscard

Returns all facts about the table from the table state

Returns
an unordered_map<std::string, std::any>

◆ has()

bool TableState::has ( const std::string & key) const

Determines whether a key exists in the TableState if yet return true, else return false

Parameters
keyto know which value exists or not
Returns
a bool determining whether a value exists or not

◆ set() [1/2]

void TableState::set ( const std::string & key,
std::any value )

Change a value in the TableState

Parameters
keyof the value to be changed
valuenew value

◆ set() [2/2]

void TableState::set ( const std::string & key,
std::any value,
const Socket & so )

Change a value in the TableState and send the change over the network

Parameters
keyof the value to be changed
valuenew value

The documentation for this class was generated from the following file: