Fawkes API
Fawkes Development Version
|
RefBox repeater state writer. More...
#include "refbox_state_writer.h"
Public Member Functions | |
RefBoxStateBBWriter (std::vector< std::string > hosts, bool debug=false) | |
Constructor. More... | |
virtual | ~RefBoxStateBBWriter () |
Destructor. More... | |
virtual void | send () |
Send worldinfo. More... | |
virtual void | set_gamestate (int game_state, fawkes::worldinfo_gamestate_team_t state_team) |
Set current game state. More... | |
virtual void | set_score (unsigned int score_cyan, unsigned int score_magenta) |
Set score. More... | |
virtual void | set_team_goal (fawkes::worldinfo_gamestate_team_t our_team, fawkes::worldinfo_gamestate_goalcolor_t goal_color) |
Set team and goal info. More... | |
virtual void | set_half (fawkes::worldinfo_gamestate_half_t half) |
Set current half of the game time. More... | |
![]() | |
RefBoxStateSender (const char *addr, unsigned short port, const char *key, const char *iv, bool debug=false) | |
Constructor. More... | |
virtual | ~RefBoxStateSender () |
Destructor. More... | |
virtual void | add_penalty (unsigned int player, unsigned int penalty, unsigned int seconds_remaining) |
Add penalty. More... | |
Additional Inherited Members | |
![]() | |
RefBoxStateSender () | |
Constructor. More... | |
RefBox repeater state writer.
Writes to GameStateInterfaces "WM GameState" of given hosts.
Definition at line 37 of file refbox_state_writer.h.
RefBoxStateBBWriter::RefBoxStateBBWriter | ( | std::vector< std::string > | hosts, |
bool | debug = false |
||
) |
Constructor.
hosts | hosts to connect to to send game state info via remote blackboard |
debug | true to enable debug output |
Definition at line 70 of file refbox_state_writer.cpp.
References fawkes::GOAL_BLUE, fawkes::GS_FROZEN, fawkes::HALF_FIRST, fawkes::TEAM_BOTH, and fawkes::TEAM_CYAN.
|
virtual |
Destructor.
Definition at line 91 of file refbox_state_writer.cpp.
References fawkes::RemoteBlackBoard::close(), fawkes::RemoteBlackBoard::open_for_writing(), fawkes::Exception::print_trace(), and fawkes::Interface::write().
|
virtual |
Send worldinfo.
Reimplemented from RefBoxStateSender.
Definition at line 285 of file refbox_state_writer.cpp.
References fawkes::Exception::print_trace(), fawkes::GameStateInterface::score_cyan(), fawkes::GameStateInterface::set_score_cyan(), and fawkes::Interface::write().
|
virtual |
Set current game state.
game_state | current game state |
state_team | team referenced by the game state |
Reimplemented from RefBoxStateSender.
Definition at line 130 of file refbox_state_writer.cpp.
References fawkes::GS_CORNER_KICK, fawkes::GS_DROP_BALL, fawkes::GS_FREE_KICK, fawkes::GS_FROZEN, fawkes::GS_GOAL_KICK, fawkes::GS_HALF_TIME, fawkes::GS_KICK_OFF, fawkes::GS_PENALTY, fawkes::GS_PLAY, fawkes::GS_THROW_IN, fawkes::GameStateInterface::set_game_state(), fawkes::GameStateInterface::set_state_team(), fawkes::TEAM_BOTH, fawkes::TEAM_CYAN, fawkes::TEAM_MAGENTA, fawkes::TEAM_NONE, and fawkes::worldinfo_gamestate_team_tostring().
|
virtual |
Set current half of the game time.
half | current half |
Reimplemented from RefBoxStateSender.
Definition at line 262 of file refbox_state_writer.cpp.
References fawkes::HALF_FIRST, fawkes::HALF_SECOND, fawkes::GameStateInterface::set_half(), and fawkes::worldinfo_gamestate_half_tostring().
|
virtual |
Set score.
score_cyan | current score of team cyan |
score_magenta | current score of team magenta |
Reimplemented from RefBoxStateSender.
Definition at line 211 of file refbox_state_writer.cpp.
References fawkes::GameStateInterface::set_score_cyan(), and fawkes::GameStateInterface::set_score_magenta().
|
virtual |
Set team and goal info.
our_team | our team color |
goal_color | our goal color |
Reimplemented from RefBoxStateSender.
Definition at line 231 of file refbox_state_writer.cpp.
References fawkes::GOAL_BLUE, fawkes::GameStateInterface::set_our_goal_color(), fawkes::GameStateInterface::set_our_team(), fawkes::TEAM_CYAN, fawkes::worldinfo_gamestate_goalcolor_tostring(), and fawkes::worldinfo_gamestate_team_tostring().