]> git.localhorst.tv Git - l2e.git/blob - src/common/Ikari.cpp
added type description of MenuProperties
[l2e.git] / src / common / Ikari.cpp
1 /*
2  * Ikari.cpp
3  *
4  *  Created on: Aug 10, 2012
5  *      Author: holy
6  */
7
8 #include "Ikari.h"
9
10 #include "../loader/TypeDescription.h"
11
12 using loader::FieldDescription;
13 using loader::TypeDescription;
14
15 namespace common {
16
17 Ikari::Ikari()
18 : name("")
19 , cost(0)
20 , isPhysical(false) {
21
22 }
23
24
25 void Ikari::CreateTypeDescription() {
26         Ikari i;
27         TypeDescription &td(TypeDescription::CreateOrGet("Ikari"));
28
29         td.SetSize(sizeof(Ikari));
30
31         int boolId(TypeDescription::GetTypeId("Boolean"));
32         int numberId(TypeDescription::GetTypeId("Number")); // FIXME: need small number type
33         int stringId(TypeDescription::GetTypeId("String"));
34         int targetsId(TypeDescription::GetTypeId("TargetingMode"));
35
36         td.AddField("name", FieldDescription(((char *)&i.name) - ((char *)&i), stringId, true));
37         td.AddField("cost", FieldDescription(((char *)&i.cost) - ((char *)&i), numberId, false));
38         td.AddField("targets", FieldDescription(((char *)&i.targetingMode) - ((char *)&i), targetsId, false));
39         td.AddField("physical", FieldDescription(((char *)&i.isPhysical) - ((char *)&i), boolId, true));
40 }
41
42 }