]> git.localhorst.tv Git - l2e.git/blob - src/map/Tile.cpp
9f75d229d0af60e1b3ee312df0d943fe3443985d
[l2e.git] / src / map / Tile.cpp
1 /*
2  * Tile.cpp
3  *
4  *  Created on: Sep 29, 2012
5  *      Author: holy
6  */
7
8 #include "Tile.h"
9
10 #include "../loader/Interpreter.h"
11 #include "../loader/TypeDescription.h"
12
13 using loader::FieldDescription;
14 using loader::Interpreter;
15 using loader::TypeDescription;
16
17 namespace map {
18
19 Tile::Tile()
20 : battlebg(0)
21 , flags(0) {
22
23 }
24
25
26 void Tile::CreateTypeDescription() {
27         Tile t;
28
29         TypeDescription &td(TypeDescription::Create(TYPE_ID, "Tile"));
30         td.SetConstructor(&Construct);
31         td.SetSize(sizeof(Tile));
32
33         td.AddField("battlebg", FieldDescription(((char *)&t.battlebg) - ((char *)&t), Interpreter::IMAGE_ID).SetReferenced());
34         td.AddField("t", FieldDescription(((char *)&t.offset) - ((char *)&t), Interpreter::VECTOR_ID));
35         td.AddField("flags", FieldDescription(((char *)&t.flags) - ((char *)&t), Interpreter::NUMBER_ID));
36
37 }
38
39 void Tile::Construct(void *data) {
40         new (data) Tile;
41 }
42
43 }