|
Fawkes API
Fawkes Development Version
|
SPL league refbox repeater. More...
#include <>>
Public Member Functions | |
| SplRefBoxRepeater (RefBoxStateSender &rss, const char *broadcast_ip, unsigned short int broadcast_port, fawkes::worldinfo_gamestate_team_t our_team, fawkes::worldinfo_gamestate_goalcolor_t our_goal) | |
| Constructor. More... | |
| ~SplRefBoxRepeater () | |
| Destructor. More... | |
| void | run () |
| Run. More... | |
SPL league refbox repeater.
This class will listen to SPL refbox commands and derive matching game states from the communication stream and send this via the world info.
| SplRefBoxRepeater::SplRefBoxRepeater | ( | RefBoxStateSender & | rss, |
| const char * | broadcast_ip, | ||
| unsigned short int | broadcast_port, | ||
| fawkes::worldinfo_gamestate_team_t | our_team, | ||
| fawkes::worldinfo_gamestate_goalcolor_t | our_goal | ||
| ) |
Constructor.
| rss | refbox state sender |
| broadcast_ip | Broadcast IP |
| broadcast_port | Broadcast port |
| our_team | our initial team |
| our_goal | our initial goal |
Definition at line 76 of file spl.cpp.
References fawkes::Socket::bind().
| SplRefBoxRepeater::~SplRefBoxRepeater | ( | ) |
Destructor.
Definition at line 96 of file spl.cpp.
References RefBoxStateSender::add_penalty(), fawkes::Socket::close(), spl_gamecontrol_t::first_half, fawkes::GS_FROZEN, fawkes::GS_SPL_FINISHED, fawkes::GS_SPL_INITIAL, fawkes::GS_SPL_PLAY, fawkes::GS_SPL_READY, fawkes::GS_SPL_SET, fawkes::HALF_FIRST, fawkes::HALF_SECOND, spl_gamecontrol_t::kick_off_team, spl_robotinfo_t::penalty, spl_teaminfo_t::players, spl_teaminfo_t::score, spl_robotinfo_t::secs_till_unpenalized, RefBoxStateSender::send(), RefBoxStateSender::set_gamestate(), RefBoxStateSender::set_half(), RefBoxStateSender::set_score(), spl_gamecontrol_t::state, fawkes::TEAM_BOTH, spl_teaminfo_t::team_color, fawkes::TEAM_CYAN, fawkes::TEAM_MAGENTA, and spl_gamecontrol_t::teams.
| void SplRefBoxRepeater::run | ( | ) |
Run.
Reads messages from the network, processes them and calls the refbox state sender.
Definition at line 155 of file spl.cpp.
References spl_gamecontrol_t::header, fawkes::Socket::recv(), and spl_gamecontrol_t::version.