blob: a2b5235d343748a76f40fdfcf33d5b2f678a29ea (
plain) (
blame)
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
|
#ifndef WORLD_H
#define WORLD_H
class World;
#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
#include <wx/treectrl.h>
#include <map>
#include <memory>
#include "map.h"
#include <list>
class MapeditFrame;
class World {
public:
World();
World(std::string filename);
std::shared_ptr<Map> newMap();
std::shared_ptr<Map> getMap(int id) const;
void setDirty(bool dirty);
bool getDirty() const;
std::string getFilename() const;
void setParent(MapeditFrame* parent);
void save(std::string filename, wxTreeCtrl* mapTree);
Map* getLastMap() const;
void setLastMap(Map* map);
std::list<std::shared_ptr<Map>> getRootMaps() const;
const std::map<int, std::shared_ptr<Map>> getMaps() const;
bool getEmpty() const;
private:
MapeditFrame* parent;
std::map<int, std::shared_ptr<Map>> maps;
int nextMapID = 0;
bool dirty = false;
std::string filename;
int lastmap = 0;
std::list<int> rootChildren;
bool empty = false;
};
#endif
|