]> git.localhorst.tv Git - l2e.git/blobdiff - src/map/Area.h
added basic map classes
[l2e.git] / src / map / Area.h
diff --git a/src/map/Area.h b/src/map/Area.h
new file mode 100644 (file)
index 0000000..9bca341
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Area.h
+ *
+ *  Created on: Sep 26, 2012
+ *      Author: holy
+ */
+
+#ifndef MAP_AREA_H_
+#define MAP_AREA_H_
+
+#include "../geometry/Vector.h"
+
+#include <SDL.h>
+
+namespace graphics {
+       class Sprite;
+}
+
+namespace map {
+
+class Tile;
+
+class Area {
+
+public:
+       Area();
+       ~Area() { }
+
+public:
+       int Width() const { return width; }
+       int Height() const { return numTiles / width + (numTiles % width ? 1 : 0); }
+
+       void Render(SDL_Surface *dest, const graphics::Sprite *tileset, const geometry::Vector<int> &offset) const;
+
+// temporary setters
+public:
+       void SetTiles(const Tile *t, int num) { tiles = t; numTiles = num; }
+       void SetWidth(int w) { width = w; }
+
+private:
+       const Tile *tiles;
+       int numTiles;
+       int width;
+
+};
+
+}
+
+#endif /* MAP_AREA_H_ */