]> git.localhorst.tv Git - l2e.git/blob - src/map/Tile.cpp
commented headers in app/ directory
[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/TypeDescription.h"
11
12 using loader::FieldDescription;
13 using loader::TypeDescription;
14
15 namespace map {
16
17 Tile::Tile()
18 : battlebg(0)
19 , flags(0) {
20
21 }
22
23
24 void Tile::CreateTypeDescription() {
25         Tile t;
26
27         int imageId(TypeDescription::GetTypeId("Image"));
28         int numberId(TypeDescription::GetTypeId("Number"));
29         int vectorId(TypeDescription::GetTypeId("Vector"));
30
31         TypeDescription &td(TypeDescription::CreateOrGet("Tile"));
32         td.SetConstructor(&Construct);
33         td.SetSize(sizeof(Tile));
34
35         td.AddField("battlebg", FieldDescription(((char *)&t.battlebg) - ((char *)&t), imageId).SetReferenced());
36         td.AddField("t", FieldDescription(((char *)&t.offset) - ((char *)&t), vectorId));
37         td.AddField("flags", FieldDescription(((char *)&t.flags) - ((char *)&t), numberId));
38
39 }
40
41 void Tile::Construct(void *data) {
42         new (data) Tile;
43 }
44
45 }