]> git.localhorst.tv Git - l2e.git/blob - src/common/Ikari.cpp
added second map area
[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
28         int boolId(TypeDescription::GetTypeId("Boolean"));
29         int numberId(TypeDescription::GetTypeId("Number")); // FIXME: need small number type
30         int stringId(TypeDescription::GetTypeId("String"));
31         int targetsId(TypeDescription::GetTypeId("TargetingMode"));
32
33         TypeDescription &td(TypeDescription::CreateOrGet("Ikari"));
34         td.SetConstructor(&Construct);
35         td.SetSize(sizeof(Ikari));
36
37         td.AddField("name", FieldDescription(((char *)&i.name) - ((char *)&i), stringId, true));
38         td.AddField("cost", FieldDescription(((char *)&i.cost) - ((char *)&i), numberId, false));
39         td.AddField("targets", FieldDescription(((char *)&i.targetingMode) - ((char *)&i), targetsId, false));
40         td.AddField("type", FieldDescription(((char *)&i.isPhysical) - ((char *)&i), boolId, false));
41 }
42
43 void Ikari::Construct(void *data) {
44         new (data) Ikari;
45 }
46
47 }