]> git.localhorst.tv Git - l2e.git/blob - src/common/Ikari.cpp
e4321497a4663f586013cb9799efd7fd37e77105
[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 "TargetingMode.h"
11 #include "../loader/Interpreter.h"
12 #include "../loader/TypeDescription.h"
13
14 using loader::FieldDescription;
15 using loader::Interpreter;
16 using loader::TypeDescription;
17
18 namespace common {
19
20 Ikari::Ikari()
21 : name("")
22 , cost(0)
23 , isPhysical(false) {
24
25 }
26
27
28 void Ikari::CreateTypeDescription() {
29         Ikari i;
30
31         TypeDescription &td(TypeDescription::Create(TYPE_ID, "Ikari"));
32         td.SetDescription(
33                         "Information of a single ikari attack.");
34         td.SetConstructor(&Construct);
35         td.SetSize(sizeof(Ikari));
36
37         td.AddField("name", FieldDescription(((char *)&i.name) - ((char *)&i), Interpreter::STRING_ID).SetReferenced().SetDescription("the attack's name"));
38         td.AddField("cost", FieldDescription(((char *)&i.cost) - ((char *)&i), Interpreter::NUMBER_ID).SetDescription("amount of ikari points needed and deducted for use"));
39         td.AddField("targets", FieldDescription(((char *)&i.targetingMode) - ((char *)&i), TargetingMode::TYPE_ID).SetDescription("how target selection is to be performed"));
40         td.AddField("type", FieldDescription(((char *)&i.isPhysical) - ((char *)&i), Interpreter::BOOLEAN_ID).SetDescription("if the attack is physical (true) or magical(false)"));
41 }
42
43 void Ikari::Construct(void *data) {
44         new (data) Ikari;
45 }
46
47 }