]> git.localhorst.tv Git - l2e.git/blobdiff - src/map/Tile.cpp
switched to static type IDs
[l2e.git] / src / map / Tile.cpp
index 303c9e556eba5fcf1836eca8b7aa1ac4b05a4fb2..9f75d229d0af60e1b3ee312df0d943fe3443985d 100644 (file)
@@ -7,6 +7,13 @@
 
 #include "Tile.h"
 
+#include "../loader/Interpreter.h"
+#include "../loader/TypeDescription.h"
+
+using loader::FieldDescription;
+using loader::Interpreter;
+using loader::TypeDescription;
+
 namespace map {
 
 Tile::Tile()
@@ -15,4 +22,22 @@ Tile::Tile()
 
 }
 
+
+void Tile::CreateTypeDescription() {
+       Tile t;
+
+       TypeDescription &td(TypeDescription::Create(TYPE_ID, "Tile"));
+       td.SetConstructor(&Construct);
+       td.SetSize(sizeof(Tile));
+
+       td.AddField("battlebg", FieldDescription(((char *)&t.battlebg) - ((char *)&t), Interpreter::IMAGE_ID).SetReferenced());
+       td.AddField("t", FieldDescription(((char *)&t.offset) - ((char *)&t), Interpreter::VECTOR_ID));
+       td.AddField("flags", FieldDescription(((char *)&t.flags) - ((char *)&t), Interpreter::NUMBER_ID));
+
+}
+
+void Tile::Construct(void *data) {
+       new (data) Tile;
+}
+
 }