-
Notifications
You must be signed in to change notification settings - Fork 1
/
Map.h
63 lines (44 loc) · 1.19 KB
/
Map.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
59
60
61
62
63
#ifndef _MAP_H_
#define _MAP_H_
#include "GameEngine.h"
#include "DEFINITIONS.h"
#include <SFML/Graphics.hpp>
#include <vector>
#include <string>
#include <memory>
class Map
{
public:
Map(GameDataRef p_data, std::unique_ptr<std::vector<std::string>>& p_level, sf::Color& p_levelColor);
Map(Map&) = delete;
Map& operator=(Map&) = delete;
~Map();
private:
GameDataRef m_data;
std::unique_ptr<std::vector<std::string>>& m_level;
sf::Color& m_levelColor;
sf::Vector2u m_spritesheetTileSize{ 16, 16 };
const unsigned int m_maxCol{ 40 };
const unsigned int m_maxLine{ 22 };
sf::VertexArray m_vertices;
sf::Texture m_tileset;
std::vector<std::string> m_path;
sf::Clock clock;
std::vector<std::vector<int>> m_holesCoords;
std::vector<sf::Clock> m_holesTimers;
float m_scaledTileSizeX{ static_cast<float>(TILE_SIZE) };
float m_scaledTileSizeY{ static_cast<float>(TILE_SIZE) };
int m_remainingBonus;
private:
void Load();
void CreatePath();
void GetNewHolesCoords();
void HoleLife();
public:
std::vector<std::string>& GetPath();
int& GetRemainingBonus();
void Update();
void Draw();
void DrawPath();
};
#endif // !_MAP_H_