Fawkes API  Fawkes Development Version
RefBoxStateSender Class Reference

RefBox repeater state sender. More...

#include "refbox_state_sender.h"

Inheritance diagram for RefBoxStateSender:

List of all members.

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.

Detailed Description

RefBox repeater state sender.

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

Author:
Tim Niemueller

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::WorldInfoTransceiver::MULTICAST, fawkes::GS_FROZEN, fawkes::TEAM_BOTH, fawkes::TEAM_CYAN, fawkes::GOAL_BLUE, and fawkes::HALF_FIRST.

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::GS_FROZEN, fawkes::TEAM_BOTH, fawkes::TEAM_CYAN, fawkes::GOAL_BLUE, and fawkes::HALF_FIRST.


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_team_tostring(), and fawkes::worldinfo_gamestate_goalcolor_tostring().


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