From 25240241e91dc913d20fbb93aa4acc9433dda6a0 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 15 Mar 2015 20:58:02 -0400 Subject: Map editor can now save and load (but not edit) entities in maps --- tools/mapedit/src/object.h | 47 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 tools/mapedit/src/object.h (limited to 'tools/mapedit/src/object.h') 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 @@ +#ifndef OBJECT_H +#define OBJECT_H + +#include + +#ifndef WX_PRECOMP +#include +#endif + +#include +#include + +class MapObjectLoadException: public std::exception +{ + public: + MapObjectLoadException(std::string mapname) : mapname(mapname) {} + + virtual const char* what() const throw() + { + return ("An error occured loading map object " + mapname).c_str(); + } + + private: + std::string mapname; +}; + +class MapObject { + public: + MapObject(const char* filename); + + static const std::map> getAllObjects(); + + std::string getType() const; + wxBitmap getSprite() const; + std::string getAction() const; + int getWidth() const; + int getHeight() const; + + private: + std::string type; + wxBitmap sprite; + std::string action; + int width; + int height; +}; + +#endif -- cgit 1.4.1