#include <refbox_state_sender.h>
Inheritance diagram for RefBoxStateSender:
Public Member Functions | |
RefBoxStateSender (const char *addr, unsigned short port, const char *key, const char *iv, bool debug=false) | |
Constructor. | |
virtual | ~RefBoxStateSender () |
Destructor. | |
virtual void | send () |
Send worldinfo. | |
virtual void | set_gamestate (int game_state, fawkes::worldinfo_gamestate_team_t state_team) |
Set current game state. | |
virtual void | set_score (unsigned int score_cyan, unsigned int score_magenta) |
Set score. | |
virtual void | set_team_goal (fawkes::worldinfo_gamestate_team_t our_team, fawkes::worldinfo_gamestate_goalcolor_t goal_color) |
Set team and goal info. | |
virtual void | set_half (fawkes::worldinfo_gamestate_half_t half) |
Set current half of the game time. | |
virtual void | add_penalty (unsigned int player, unsigned int penalty, unsigned int seconds_remaining) |
Add penalty. | |
Protected Member Functions | |
RefBoxStateSender () | |
Constructor. | |
Classes | |
struct | rss_penalty_t |
class | TimeoutThread |
Timeout thread. More... |
Adapter to the WorldInfoTransceiver, provides easy optional debugging output to stdout.
Definition at line 34 of file refbox_state_sender.h.
RefBoxStateSender::RefBoxStateSender | ( | const char * | addr, | |
unsigned short | port, | |||
const char * | key, | |||
const char * | iv, | |||
bool | debug = false | |||
) |
Constructor.
addr | multicast address to send information to and receive from | |
port | UDP port to send information to and receive from | |
key | encryption key | |
iv | encryption initialisation vector | |
debug | true to enable debug output |
Definition at line 46 of file refbox_state_sender.cpp.
References fawkes::GOAL_BLUE, fawkes::GS_FROZEN, fawkes::HALF_FIRST, fawkes::WorldInfoTransceiver::set_loop(), fawkes::TEAM_BOTH, and fawkes::TEAM_CYAN.
RefBoxStateSender::~RefBoxStateSender | ( | ) | [virtual] |
Destructor.
Definition at line 84 of file refbox_state_sender.cpp.
References fawkes::Thread::cancel(), and fawkes::Thread::join().
RefBoxStateSender::RefBoxStateSender | ( | ) | [protected] |
Constructor.
Only to be used by derivatives. These must implement the send() method!
Definition at line 68 of file refbox_state_sender.cpp.
References fawkes::GOAL_BLUE, fawkes::GS_FROZEN, fawkes::HALF_FIRST, fawkes::TEAM_BOTH, and fawkes::TEAM_CYAN.
void RefBoxStateSender::add_penalty | ( | unsigned int | player, | |
unsigned int | penalty, | |||
unsigned int | seconds_remaining | |||
) | [virtual] |
Add penalty.
player | number of the player to add the penalty for | |
penalty | penalty code | |
seconds_remaining | estimated time when the penalty will be lifted |
Definition at line 166 of file refbox_state_sender.cpp.
void RefBoxStateSender::send | ( | ) | [virtual] |
Send worldinfo.
Reimplemented in RefBoxStateBBWriter.
Definition at line 179 of file refbox_state_sender.cpp.
References fawkes::Thread::cancel(), fawkes::Thread::join(), and fawkes::Thread::start().
void RefBoxStateSender::set_gamestate | ( | int | game_state, | |
fawkes::worldinfo_gamestate_team_t | state_team | |||
) | [virtual] |
Set current game state.
game_state | current game state | |
state_team | team referenced by the game state |
Reimplemented in RefBoxStateBBWriter.
Definition at line 100 of file refbox_state_sender.cpp.
References fawkes::worldinfo_gamestate_team_tostring().
void RefBoxStateSender::set_half | ( | fawkes::worldinfo_gamestate_half_t | half | ) | [virtual] |
Set current half of the game time.
half | current half |
Reimplemented in RefBoxStateBBWriter.
Definition at line 150 of file refbox_state_sender.cpp.
References fawkes::worldinfo_gamestate_half_tostring().
void RefBoxStateSender::set_score | ( | unsigned int | score_cyan, | |
unsigned int | score_magenta | |||
) | [virtual] |
Set score.
score_cyan | current score of team cyan | |
score_magenta | current score of team magenta |
Reimplemented in RefBoxStateBBWriter.
Definition at line 118 of file refbox_state_sender.cpp.
void RefBoxStateSender::set_team_goal | ( | fawkes::worldinfo_gamestate_team_t | our_team, | |
fawkes::worldinfo_gamestate_goalcolor_t | goal_color | |||
) | [virtual] |
Set team and goal info.
our_team | our team color | |
goal_color | our goal color |
Reimplemented in RefBoxStateBBWriter.
Definition at line 133 of file refbox_state_sender.cpp.
References fawkes::worldinfo_gamestate_goalcolor_tostring(), and fawkes::worldinfo_gamestate_team_tostring().