]> git.localhorst.tv Git - l2e.git/blobdiff - src/map/Area.cpp
removed stupid file headers that eclipse put in
[l2e.git] / src / map / Area.cpp
index 985dea2d5462f4aae5ecba7663d6c79651f635d3..a64dab2a928ea1b479860ee1f1220ff7623bcf76 100644 (file)
@@ -1,19 +1,17 @@
-/*
- * Area.cpp
- *
- *  Created on: Sep 26, 2012
- *      Author: holy
- */
-
 #include "Area.h"
 
 #include "Tile.h"
 #include "../graphics/Sprite.h"
+#include "../loader/TypeDescription.h"
+#include "../loader/Interpreter.h"
 #include "../sdl/utility.h"
 
 #include <stdexcept>
 
 using geometry::Vector;
+using loader::FieldDescription;
+using loader::Interpreter;
+using loader::TypeDescription;
 
 namespace map {
 
@@ -86,4 +84,21 @@ void Area::RenderDebug(SDL_Surface *dest, const graphics::Sprite *tileset, const
        }
 }
 
+
+void Area::CreateTypeDescription() {
+       Area a;
+
+       TypeDescription &td(TypeDescription::Create(TYPE_ID, "Area"));
+       td.SetConstructor(&Construct);
+       td.SetSize(sizeof(Area));
+
+       td.AddField("battlebg", FieldDescription(((char *)&a.battlebg) - ((char *)&a), Interpreter::IMAGE_ID).SetReferenced());
+       td.AddField("tiles", FieldDescription(((char *)&a.tiles) - ((char *)&a), Tile::TYPE_ID).SetReferenced().SetAggregate());
+       td.AddField("width", FieldDescription(((char *)&a.width) - ((char *)&a), Interpreter::NUMBER_ID));
+}
+
+void Area::Construct(void *data) {
+       new (data) Area;
+}
+
 }