]> git.localhorst.tv Git - l2e.git/blob - src/map/Trigger.cpp
added Sort function to Inventory
[l2e.git] / src / map / Trigger.cpp
1 /*
2  * Trigger.cpp
3  *
4  *  Created on: Oct 3, 2012
5  *      Author: holy
6  */
7
8 #include "Trigger.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 Trigger::Trigger()
20 : script(0)
21 , type(TYPE_CONTACT) {
22
23 }
24
25
26 void Trigger::CreateTypeDescription() {
27         Trigger t;
28
29         TypeDescription &td(TypeDescription::Create(TYPE_ID, "Trigger"));
30         td.SetConstructor(&Construct);
31         td.SetSize(sizeof(Trigger));
32
33         td.AddField("script", FieldDescription(((char *)&t.script) - ((char *)&t), Interpreter::SCRIPT_ID).SetReferenced());
34         td.AddField("position", FieldDescription(((char *)&t.tilePosition) - ((char *)&t), Interpreter::VECTOR_ID));
35         td.AddField("type", FieldDescription(((char *)&t.type) - ((char *)&t), Interpreter::NUMBER_ID));
36 }
37
38 void Trigger::Construct(void *data) {
39         new (data) Trigger;
40 }
41
42 }