The Battle for Wesnoth  1.15.2+dev
countdown_clock.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2017-2018 by the Battle for Wesnoth Project https://www.wesnoth.org/
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY.
10 
11  See the COPYING file for more details.
12 */
13 
14 #pragma once
15 #include "events.hpp"
16 #include <SDL2/SDL_timer.h>
17 
18 class team;
20 {
21 public:
24  /// @returns ticks passed since last update
25  /// @param new_timestamp latest result of SDL_GetTicks()
26  int update_timestamp(int new_timestamp);
27  /// @param new_timestamp latest result of SDL_GetTicks()
28  void update_team(int new_timestamp);
30  /// @return whether there is time left
31  /// @param new_timestamp latest result of SDL_GetTicks()
32  bool update(int new_timestamp = SDL_GetTicks());
33  void maybe_play_sound();
34 private:
35  team& team_;
38 };
countdown_clock(team &team)
int update_timestamp(int new_timestamp)
logger & info()
Definition: log.cpp:90
This class stores all the data for a single &#39;side&#39; (in game nomenclature).
Definition: team.hpp:44
void process(events::pump_info &info)
void update_team(int new_timestamp)
bool update(int new_timestamp=SDL_GetTicks())