Fawkes API
Fawkes Development Version
|
RefBox repeater state sender. More...
#include "refbox_state_sender.h"
Classes | |
class | TimeoutThread |
Timeout thread. More... |
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. |
RefBox repeater state sender.
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 47 of file refbox_state_sender.cpp.
References fawkes::GOAL_BLUE, fawkes::GS_FROZEN, fawkes::HALF_FIRST, fawkes::WorldInfoTransceiver::MULTICAST, fawkes::TEAM_BOTH, and fawkes::TEAM_CYAN.
|
virtual |
Destructor.
Definition at line 85 of file refbox_state_sender.cpp.
|
protected |
Constructor.
Only to be used by derivatives. These must implement the send() method!
Definition at line 69 of file refbox_state_sender.cpp.
References fawkes::GOAL_BLUE, fawkes::GS_FROZEN, fawkes::HALF_FIRST, fawkes::TEAM_BOTH, and fawkes::TEAM_CYAN.
|
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 167 of file refbox_state_sender.cpp.
|
virtual |
Send worldinfo.
Reimplemented in RefBoxStateBBWriter.
Definition at line 180 of file refbox_state_sender.cpp.
|
virtual |
Set current game state.
game_state | current game state |
state_team | team referenced by the game state |
Reimplemented in RefBoxStateBBWriter.
Definition at line 101 of file refbox_state_sender.cpp.
References fawkes::worldinfo_gamestate_team_tostring().
|
virtual |
Set current half of the game time.
half | current half |
Reimplemented in RefBoxStateBBWriter.
Definition at line 151 of file refbox_state_sender.cpp.
References fawkes::worldinfo_gamestate_half_tostring().
|
virtual |
Set score.
score_cyan | current score of team cyan |
score_magenta | current score of team magenta |
Reimplemented in RefBoxStateBBWriter.
Definition at line 119 of file refbox_state_sender.cpp.
|
virtual |
Set team and goal info.
our_team | our team color |
goal_color | our goal color |
Reimplemented in RefBoxStateBBWriter.
Definition at line 134 of file refbox_state_sender.cpp.
References fawkes::worldinfo_gamestate_goalcolor_tostring(), and fawkes::worldinfo_gamestate_team_tostring().