X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmap%2FTile.cpp;h=d621747996a0a70c7261ce215ed28139f0c9f3a4;hb=60e0fe29ce6cd033edc78b181d9d07fa72c11172;hp=303c9e556eba5fcf1836eca8b7aa1ac4b05a4fb2;hpb=0ad5ca97b5df217329bc319d62564a9f46ba11d7;p=l2e.git diff --git a/src/map/Tile.cpp b/src/map/Tile.cpp index 303c9e5..d621747 100644 --- a/src/map/Tile.cpp +++ b/src/map/Tile.cpp @@ -1,12 +1,12 @@ -/* - * Tile.cpp - * - * Created on: Sep 29, 2012 - * Author: holy - */ - #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 +15,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; +} + }