Botball Game State
A game stared library for Botball, it helps model the table and different phases of the competition.
Loading...
Searching...
No Matches
PhaseState Class Reference

Public Member Functions

 PhaseState (Phase phase_bot_a, Phase phase_bot_b)
std::string get_phase_id_a ()
std::string get_phase_id_b ()
void set_phase_id_a (const std::string &phase_id_a)
void set_phase_id_b (const std::string &phase_id_b)
std::vector< Phase > & get_open_phases ()
const std::vector< Phase > & get_open_phases_const () const
Phase get_phase (const std::string &phase_id)
Phaseget_phase_ptr (const std::string &phase_id)
bool has_phase (const std::string &phase_id)
void clean ()

Member Function Documentation

◆ clean()

void PhaseState::clean ( )

Iterates over all open phases and removes the phases that have status DONE or TIMEOUT

◆ get_open_phases()

std::vector< Phase > & PhaseState::get_open_phases ( )
nodiscard

Returns a mutable reference to a vector of all phases that are not DONE or TIMEOUT

Returns
a mutable reference to a vector of all open phases on both bots

◆ get_open_phases_const()

const std::vector< Phase > & PhaseState::get_open_phases_const ( ) const
nodiscard

Returns an immutable reference to a vector of all phases that are not DONE or TIMEOUT

Returns
an immutable reference to a vector of all open phases on both bots

◆ get_phase_id_a()

std::string PhaseState::get_phase_id_a ( )
nodiscard

Gets the id of bot_a's currently active phase

Returns
the id of the phase running on bot_a

◆ get_phase_id_b()

std::string PhaseState::get_phase_id_b ( )
nodiscard

Gets the id of bot_b's currently active phase

Returns
the id of the phase running on bot_b

◆ has_phase()

bool PhaseState::has_phase ( const std::string & phase_id)

Determines whether a phase exists in all open phases

Parameters
phase_idid of the phase to check
Returns
a bool representing if the phase exist or not

◆ set_phase_id_a()

void PhaseState::set_phase_id_a ( const std::string & phase_id_a)

Sets the phase that bot_a is executing

Parameters
phase_id_athe phase id of bot_a's next phase

◆ set_phase_id_b()

void PhaseState::set_phase_id_b ( const std::string & phase_id_b)

Sets the phase that bot_a is executing

Parameters
phase_id_bthe phase id of bot_b's next phase

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