summary refs log tree commit diff stats
path: root/src/map.h
blob: a562becf27ef628986014f880c5cbbe13ea1a16c (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(const 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(const std::string name);
    
    const int* getMapdata() const;
    const char* 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;
    char* title;
    std::string name;
    const Map* leftMap = nullptr;
    const Map* rightMap = nullptr;
    std::list<EntityData> entities;
};

#endif