about summary refs log tree commit diff stats
path: root/data/maps/the_sweet
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2025-10-06 14:22:10 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2025-10-06 14:22:10 -0400
commit239cd63658fcefcdf8531f8fa2fab2d5f1209d81 (patch)
tree2fd06de6e4ae0ee20374f5115f0791324a26ba5b /data/maps/the_sweet
parent2b0b477dcd7a12202ae13d24cde4ba3171ee7edf (diff)
downloadlingo2-archipelago-239cd63658fcefcdf8531f8fa2fab2d5f1209d81.tar.gz
lingo2-archipelago-239cd63658fcefcdf8531f8fa2fab2d5f1209d81.tar.bz2
lingo2-archipelago-239cd63658fcefcdf8531f8fa2fab2d5f1209d81.zip
Error when no progression
Diffstat (limited to 'data/maps/the_sweet')
0 files changed, 0 insertions, 0 deletions
py/blame/tools/mapedit/src/map.h?h=proto-objs&id=6b1dcc5df51df4a2d8b724187eb1bcdb4fd9df8b'>^
f732cda ^
3653629 ^
281bdf9 ^
3653629 ^
b563953 ^













91640f2 ^













b563953 ^

0d30e9b ^
b563953 ^





103587c ^






f732cda ^






103587c ^




f732cda ^



103587c ^
f732cda ^
103587c ^
f732cda ^
0d30e9b ^
c125c1a ^
91640f2 ^
c46db36 ^
0d30e9b ^


29f818c ^
e882367 ^
103587c ^

3653629 ^
0d30e9b ^


e882367 ^

0d30e9b ^


e882367 ^
103587c ^
91640f2 ^

0d30e9b ^

c46db36 ^
b563953 ^
0d30e9b ^

0d30e9b ^

e882367 ^
103587c ^

f732cda ^













b563953 ^


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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132




                    

                  
                 
                        
              
                   
 
            
                   
                     
 













                                                                 













                                                                 

           
                              





                                              






                        






                         




                                     



                                                        
                                                    
                                                      
                                                    
    
                      
                                 
                                      
                                                                         


                                                        
                            
                           

                                                            
    


                                                              

                                                                              


                                        
                             
                                                                                        

          

                 
                                                       
                 

                                       

                            
                        

                                          













                                                   


      
#ifndef MAP_H
#define MAP_H

#include <string>
#include <exception>
#include <utility>
#include <list>
#include <memory>
#include <wx/treectrl.h>
#include <map>
#include "object.h"

class World;
class MapeditFrame;
class MapEntryObject;

class MapLoadException: public std::exception
{
  public:
    MapLoadException(std::string mapname) : mapname(mapname) {}
    
    virtual const char* what() const throw()
    {
      return ("An error occured loading map " + mapname).c_str();
    }
    
  private:
    std::string mapname;
};

class MapWriteException: public std::exception
{
  public:
    MapWriteException(std::string mapname) : mapname(mapname) {}
    
    virtual const char* what() const throw()
    {
      return ("An error occured writing map " + mapname).c_str();
    }
    
  private:
    std::string mapname;
};

class Map {
  public:
    Map(int id, World* world);
    Map(const Map& map);
    Map(Map&& map);
    ~Map();
    Map& operator= (Map other);
    friend void swap(Map& first, Map& second);
    
    enum class MoveDir {
      Left,
      Right,
      Up,
      Down
    };
    
    enum class MoveType {
      Wall,
      Wrap,
      Warp,
      ReverseWarp
    };
    
    struct Adjacent {
      MoveType type = MoveType::Wall;
      int map = 0;
    };
    
    static std::list<MoveType> listMoveTypes();
    static std::string stringForMoveType(MoveType type);
    static bool moveTypeTakesMap(MoveType type);
    static std::string shortForMoveType(MoveType type);
    static std::string shortForMoveDir(MoveDir dir);
    static MoveType moveTypeForShort(std::string str);
    static MoveDir moveDirForShort(std::string str);
    
    int getID() const;
    std::string getTitle() const;
    int getTileAt(int x, int y) const;
    const std::list<std::shared_ptr<MapObjectEntry>>& getObjects() const;
    wxTreeItemId getTreeItemId() const;
    std::list<std::shared_ptr<Map>> getChildren() const;
    bool getExpanded() const;
    World* getWorld() const;
    bool getHidden() const;
    const std::map<MoveDir, Adjacent>& getAdjacents() const;
    const Adjacent& getAdjacent(MoveDir direction) const;
    
    void setTitle(std::string title, bool dirty = true);
    void setTileAt(int x, int y, int tile, bool dirty = true);
    void setMapdata(int* mapdata, bool dirty = true);
    void addObject(std::shared_ptr<MapObjectEntry> obj, bool dirty = true);
    void removeObject(std::shared_ptr<MapObjectEntry> obj, bool dirty = true);
    void setTreeItemId(wxTreeItemId id);
    void addChild(int id);
    void setExpanded(bool exp);
    void setHidden(bool hid);
    void setAdjacent(MoveDir direction, MoveType type, int map = -1, bool dirty = true);
    
  private:
    int id;
    World* world;
    std::list<std::shared_ptr<MapObjectEntry>> objects;
    int* mapdata;
    std::string title {"Untitled Map"};
    std::list<int> children;
    wxTreeItemId treeItemId;
    bool expanded = false;
    bool hidden = false;
    std::map<MoveDir, Adjacent> adjacents;
    const Adjacent defaultAdjacent {};
};

class MapPtrCtr : public wxTreeItemData {
  public:
    Map* map;
  
    MapPtrCtr(Map* map) : map(map) {}
};

class MoveTypeCtr {
  public:
    Map::MoveType type;
    
    MoveTypeCtr(Map::MoveType type) : type(type) {}
};

#endif