-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWorld.hpp
executable file
·42 lines (36 loc) · 1.28 KB
/
World.hpp
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
#ifndef WORLD_HPP_INCLUDED
#define WORLD_HPP_INCLUDED
#include <vector>
#include <map>
#include "Tile.hpp"
class World
{
//TODO passing tileREF
public:
//World(const std::string& filepath, int width); // always square?
// World(Tile testTile);
World(const std::string& filepath,unsigned int width, unsigned int height
,std::map<std::string, Tile> &m_tileRefResources);//height width in first line
~World(){};
int m_width;
int m_height;
int m_gridSize = 16;
float m_scale = 1.0;
std::vector<Tile> m_tileVector;
std::vector<int> m_selected;
//std::map<std::string, Tile> m_tileRefResources;
//Tile tile;
sf::Texture temp;
//("assets/Tile/commercial.png",TileType::EMPTY);
//Tile** m_tileArray;//2d array of size width x width
//int& at(int x, int y);//returns refernce to arr[x][y]
void load(const std::string& filepath,std::map<std::string, Tile> &m_tileRefResources);//load from disk
void save(const std::string& filepath);//save to disk
void draw(sf::RenderWindow& window, float dt);
void select(sf::Vector2f mousePos);
void replaceTiles(Tile tile);
void clearSelected();
void selectArea(sf::Vector2f mousePosBeg, sf::Vector2f mousePosEnd);
void rotateRoads();
};
#endif // WORLD_HPP_INCLUDED