1// SuperTux
2// Copyright (C) 2003 Tobias Glaesser <tobi.web@gmx.de>
3// 2006 Matthias Braun <matze@braunis.de>
4// 2018 Ingo Ruhnke <grumbel@gmail.com>
5//
6// This program is free software: you can redistribute it and/or modify
7// it under the terms of the GNU General Public License as published by
8// the Free Software Foundation, either version 3 of the License, or
9// (at your option) any later version.
10//
11// This program is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15//
16// You should have received a copy of the GNU General Public License
17// along with this program. If not, see <http://www.gnu.org/licenses/>.
18
19#ifndef HEADER_SUPERTUX_SUPERTUX_PLAYER_STATUS_HUD_HPP
20#define HEADER_SUPERTUX_SUPERTUX_PLAYER_STATUS_HUD_HPP
21
22#include "supertux/game_object.hpp"
23
24#include "video/color.hpp"
25#include "video/surface_ptr.hpp"
26
27class DrawingContext;
28class PlayerStatus;
29
30class PlayerStatusHUD : public GameObject
31{
32private:
33 static Color text_color;
34
35public:
36 PlayerStatusHUD(PlayerStatus& player_status);
37
38 virtual void update(float dt_sec) override;
39 virtual void draw(DrawingContext& context) override;
40
41 virtual bool is_saveable() const override { return false; }
42 virtual bool is_singleton() const override { return true; }
43
44 void reset();
45
46private:
47 PlayerStatus& m_player_status;
48 int displayed_coins;
49 int displayed_coins_frame;
50 SurfacePtr coin_surface;
51
52private:
53 PlayerStatusHUD(const PlayerStatusHUD&) = delete;
54 PlayerStatusHUD& operator=(const PlayerStatusHUD&) = delete;
55};
56
57#endif
58
59/* EOF */
60