Fawkes API  Fawkes Development Version
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
RefBoxStateSender Class Reference

RefBox repeater state sender. More...

#include "refbox_state_sender.h"

Inheritance diagram for RefBoxStateSender:

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. More...
 
virtual ~RefBoxStateSender ()
 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...
 
virtual void add_penalty (unsigned int player, unsigned int penalty, unsigned int seconds_remaining)
 Add penalty. More...
 

Protected Member Functions

 RefBoxStateSender ()
 Constructor. More...
 

Detailed Description

RefBox repeater state sender.

Adapter to the WorldInfoTransceiver, provides easy optional debugging output to stdout.

Author
Tim Niemueller

Definition at line 34 of file refbox_state_sender.h.

Constructor & Destructor Documentation

RefBoxStateSender::RefBoxStateSender ( const char *  addr,
unsigned short  port,
const char *  key,
const char *  iv,
bool  debug = false 
)

Constructor.

Parameters
addrmulticast address to send information to and receive from
portUDP port to send information to and receive from
keyencryption key
ivencryption initialisation vector
debugtrue 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.

RefBoxStateSender::~RefBoxStateSender ( )
virtual

Destructor.

Definition at line 85 of file refbox_state_sender.cpp.

RefBoxStateSender::RefBoxStateSender ( )
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.

Member Function Documentation

void RefBoxStateSender::add_penalty ( unsigned int  player,
unsigned int  penalty,
unsigned int  seconds_remaining 
)
virtual

Add penalty.

Parameters
playernumber of the player to add the penalty for
penaltypenalty code
seconds_remainingestimated time when the penalty will be lifted

Definition at line 167 of file refbox_state_sender.cpp.

void RefBoxStateSender::send ( )
virtual

Send worldinfo.

Reimplemented in RefBoxStateBBWriter.

Definition at line 180 of file refbox_state_sender.cpp.

void RefBoxStateSender::set_gamestate ( int  game_state,
fawkes::worldinfo_gamestate_team_t  state_team 
)
virtual

Set current game state.

Parameters
game_statecurrent game state
state_teamteam referenced by the game state

Reimplemented in RefBoxStateBBWriter.

Definition at line 101 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.

Parameters
halfcurrent half

Reimplemented in RefBoxStateBBWriter.

Definition at line 151 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.

Parameters
score_cyancurrent score of team cyan
score_magentacurrent score of team magenta

Reimplemented in RefBoxStateBBWriter.

Definition at line 119 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.

Parameters
our_teamour team color
goal_colorour 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().


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