-
Notifications
You must be signed in to change notification settings - Fork 2
/
sfml_shop_overlay.h
55 lines (34 loc) · 1.01 KB
/
sfml_shop_overlay.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
#ifndef SFML_OVERLAY_OVERLAY_H
#define SFML_OVERLAY_OVERLAY_H
#include "sfml_button.h"
#include "game_state.h"
#include "game.h"
#include "sfml_camera.h"
#include <SFML/Graphics.hpp>
class sfml_shop_overlay
{
public:
sfml_shop_overlay();
void exec(game& g, sfml_camera& m_camera);
///@param game state to change to
void close(game_state s);
///Close the game
void close();
void set_positions();
void draw_objects();
std::string extract_ints(std::ctype_base::mask category, std::string str, std::ctype<char> const& facet);
std::string extract_ints(std::string str);
void button_clicked(sf::Text button, game& g);
void place_on_grid(game& g);
private:
sf::RenderWindow& m_window;
sf::Font m_font;
sf::Text m_header;
sfml_button m_button1;
sfml_button m_button2;
sf::RectangleShape m_bg_rect;
bool follow_tile = false;
int m_price;
};
sf::Vector2f get_grid_position(sfml_button & b, int x_p, int y_p);
#endif // SFML_OVERLAY_OVERLAY_H