From b563953a4846bab720cae17ef4ab5a8296730c7c Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 14 Mar 2015 21:02:01 -0400 Subject: Started writing map editor --- tools/mapedit/src/map.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tools/mapedit/src/map.h (limited to 'tools/mapedit/src/map.h') diff --git a/tools/mapedit/src/map.h b/tools/mapedit/src/map.h new file mode 100644 index 0000000..83244f3 --- /dev/null +++ b/tools/mapedit/src/map.h @@ -0,0 +1,44 @@ +#ifndef MAP_H +#define MAP_H + +#include +#include + +const int TILE_WIDTH = 8; +const int TILE_HEIGHT = 8; +const int GAME_WIDTH = 320; +const int GAME_HEIGHT = 200; +const int MAP_WIDTH = GAME_WIDTH/TILE_WIDTH; +const int MAP_HEIGHT = GAME_HEIGHT/TILE_HEIGHT - 1; + +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 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); + + int* mapdata; + std::string title; + std::string leftmap; + std::string rightmap; +}; + +#endif -- cgit 1.4.1