summary refs log tree commit diff stats
path: root/src/map.h
blob: 3b3d42c6356ad5161005a1064136decc3ee19734 (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
#ifndef MAP_H
#define MAP_H

#include <string>
#include <list>

class Entity;

class Map {
  public:
    Map();
    Map(std::string name);
    Map(const Map& map);
    Map(Map&& map);
    ~Map();
    Map& operator= (Map other);
    friend void swap(Map& first, Map& second);
    
    static Map& getNamedMap(std::string name);
    
    const int* getMapdata() const;
    std::string getTitle() const;
    const Map* getLeftMap() const;
    const Map* getRightMap() const;
    void setLeftMap(const Map* m);
    void setRightMap(const Map* m);
    void createEntities(std::list<std::shared_ptr<Entity>>& entities) const;
    bool operator==(const Map& other) const;
    bool operator!=(const Map& other) const;
  private:
    struct EntityData {
      std::string name;
      std::pair<double, double> position;
    };
    
    int* mapdata;
    std::string title;
    std::string name;
    const Map* leftMap = nullptr;
    const Map* rightMap = nullptr;
    std::list<EntityData> entities;
};

#endif