|
Botball Game State
A game stared library for Botball, it helps model the table and different phases of the competition.
|
#include <Phase.h>
Public Member Functions | |
| Phase (const std::string &phase_id, const json &data) | |
| const std::string | get_id () const |
| int | get_time_to_completion () const |
| const std::string & | get_allowed_agent () const |
| const std::unordered_map< std::string, std::any > & | get_conditions () const |
| const std::unordered_map< std::string, std::any > & | get_completion () const |
| bool | get_done () const |
| int | get_points () const |
| PhaseStatus | get_status () const |
| void | set_status (PhaseStatus status) |
| void | set_status (PhaseStatus status, const Socket &so) |
| void | execute (TableState &table, const std::function< void()> &action, const Socket &so) |
| std::string | to_string () const |
An Object representing a task on the Botball Game Table
| void Phase::execute | ( | TableState & | table, |
| const std::function< void()> & | action, | ||
| const Socket & | so ) |
Executes the phase action, mutates the table state to reflect the changes made by the action and sets the PhaseStatus to DONE
| table | a reference to the table state so that it may be changed on commpletion |
| action | a void(void) function that will be executed by the phase |
| so | socket to pass to table state for sending updates over the network |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
| void Phase::set_status | ( | PhaseStatus | status | ) |
Sets the PhaseStatus of a phase
| status | the phase should be in |
| void Phase::set_status | ( | PhaseStatus | status, |
| const Socket & | so ) |
Sets the PhaseStatus of a phase and sends it to the peer bot
| status | the phase should be in |
| so | used to send a request to the peer bot |