summary refs log tree commit diff stats
path: root/tools/mapedit/src/world.h
blob: 7d796ccd75a6c5703a776a7a0a0421a2423f3570 (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
#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;
    std::list<std::shared_ptr<Map>> getRootMaps() const;
    const std::map<int, std::shared_ptr<Map>> getMaps() 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;
};

#endif