-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathHud.h
59 lines (47 loc) · 1.28 KB
/
Hud.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#pragma once
#include "Object.h"
#include "BitmapText.h"
#include "GridObject.h"
#include "Tree.h"
#include <SFML/Graphics.hpp>
class Hud : public Object {
public:
void init() override;
void update(sf::Time elapsed) override;
void populateInfo(std::shared_ptr<GridObject> object);
bool isCursorOnHud() const;
bool isCursorOnFastButton();
void chooseUpgrade(int selection);
private:
// Inherited via Drawable
virtual void draw(sf::RenderTarget &target, sf::RenderStates states) const override;
void loadStats(std::shared_ptr<Tree> tree);
void renderCost(sf::RenderTarget &target, int light, int nutrients) const;
void updateDeltaTexts(sf::Time elapsed);
// Internal data
float lastLight;
float lastWater;
float lastNutrients;
// Resources
sf::Sprite dayBarSprite;
sf::RectangleShape dayBar;
sf::Sprite dayBarBg;
sf::Sprite sunSprite;
sf::Sprite fastButton;
sf::Sprite infoPane;
BitmapText infoTitle;
BitmapText infoDescription;
std::vector<BitmapText> stats;
BitmapText upgrade1Text;
BitmapText upgrade2Text;
BitmapText upgrade3Text;
sf::Sprite costPane;
sf::Sprite resourcesHud;
BitmapText dayText;
BitmapText lightText;
BitmapText lightDeltaText;
BitmapText waterText;
BitmapText waterDeltaText;
BitmapText nutrientsText;
BitmapText nutrientsDeltaText;
};