summary refs log tree commit diff stats
path: root/tools/mapedit/src/object.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2015-03-15 20:58:02 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2015-03-15 20:58:02 -0400
commit25240241e91dc913d20fbb93aa4acc9433dda6a0 (patch)
treede4f80fefc08d30716f564872e296748c7cdd452 /tools/mapedit/src/object.h
parent440df3425dcc2376755d622ad6fd965eb25a25c2 (diff)
downloadtherapy-25240241e91dc913d20fbb93aa4acc9433dda6a0.tar.gz
therapy-25240241e91dc913d20fbb93aa4acc9433dda6a0.tar.bz2
therapy-25240241e91dc913d20fbb93aa4acc9433dda6a0.zip
Map editor can now save and load (but not edit) entities in maps
Diffstat (limited to 'tools/mapedit/src/object.h')
-rw-r--r--tools/mapedit/src/object.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/tools/mapedit/src/object.h b/tools/mapedit/src/object.h new file mode 100644 index 0000000..bfb493c --- /dev/null +++ b/tools/mapedit/src/object.h
@@ -0,0 +1,47 @@
1#ifndef OBJECT_H
2#define OBJECT_H
3
4#include <wx/wxprec.h>
5
6#ifndef WX_PRECOMP
7#include <wx/wx.h>
8#endif
9
10#include <string>
11#include <map>
12
13class MapObjectLoadException: public std::exception
14{
15 public:
16 MapObjectLoadException(std::string mapname) : mapname(mapname) {}
17
18 virtual const char* what() const throw()
19 {
20 return ("An error occured loading map object " + mapname).c_str();
21 }
22
23 private:
24 std::string mapname;
25};
26
27class MapObject {
28 public:
29 MapObject(const char* filename);
30
31 static const std::map<std::string, std::shared_ptr<MapObject>> getAllObjects();
32
33 std::string getType() const;
34 wxBitmap getSprite() const;
35 std::string getAction() const;
36 int getWidth() const;
37 int getHeight() const;
38
39 private:
40 std::string type;
41 wxBitmap sprite;
42 std::string action;
43 int width;
44 int height;
45};
46
47#endif