The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
countdown_clock Class Reference

#include <countdown_clock.hpp>

Inheritance diagram for countdown_clock:
Inheritance graph

Public Member Functions

 countdown_clock (team &team)
 
 ~countdown_clock ()
 
int update_timestamp (int new_timestamp)
 
void update_team (int new_timestamp)
 
void process (events::pump_info &info)
 
bool update (int new_timestamp=SDL_GetTicks())
 
void maybe_play_sound ()
 
- Public Member Functions inherited from events::pump_monitor
 pump_monitor ()
 
virtual ~pump_monitor ()
 

Private Attributes

teamteam_
 
int last_timestamp_
 
bool playing_sound_
 

Detailed Description

Definition at line 7 of file countdown_clock.hpp.

Constructor & Destructor Documentation

countdown_clock::countdown_clock ( team team)

Definition at line 16 of file countdown_clock.cpp.

countdown_clock::~countdown_clock ( )

Definition at line 24 of file countdown_clock.cpp.

References playing_sound_, and sound::stop_bell().

Member Function Documentation

void countdown_clock::maybe_play_sound ( )
void countdown_clock::process ( events::pump_info info)
virtual

Implements events::pump_monitor.

Definition at line 46 of file countdown_clock.cpp.

References events::pump_info::ticks(), and update().

bool countdown_clock::update ( int  new_timestamp = SDL_GetTicks())
Returns
whether there is time left
Parameters
new_timestamplatest result of SDL_GetTicks()

Definition at line 53 of file countdown_clock.cpp.

References team::countdown_time(), maybe_play_sound(), team_, and update_team().

Referenced by process().

void countdown_clock::update_team ( int  new_timestamp)
Parameters
new_timestamplatest result of SDL_GetTicks()

Definition at line 39 of file countdown_clock.cpp.

References team::countdown_time(), team::set_countdown_time(), team_, and update_timestamp().

Referenced by update().

int countdown_clock::update_timestamp ( int  new_timestamp)
Returns
ticks passed since last update
Parameters
new_timestamplatest result of SDL_GetTicks()

Definition at line 32 of file countdown_clock.cpp.

References last_timestamp_.

Referenced by update_team().

Member Data Documentation

int countdown_clock::last_timestamp_
private

Definition at line 24 of file countdown_clock.hpp.

Referenced by update_timestamp().

bool countdown_clock::playing_sound_
private

Definition at line 25 of file countdown_clock.hpp.

Referenced by maybe_play_sound(), and ~countdown_clock().

team& countdown_clock::team_
private

Definition at line 23 of file countdown_clock.hpp.

Referenced by maybe_play_sound(), update(), and update_team().


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