summary refs log tree commit diff stats
path: root/tools/mapedit/src/world.h
blob: 68c960f750c0b8dcedc7f5c25f63bcd04402f791 (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
49
50
51
52
53
#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;
    Map* getStartingMap() const;
    std::pair<double, double> getStartingPosition() const;
    void setStart(Map* map, std::pair<double, double> startPos); 
    
  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;
    int startingMap = 0;
    std::pair<int, int> startingPosition {100, 100};
};

#endif