]> git.localhorst.tv Git - l2e.git/blob - src/common/TargetingMode.cpp
19b41ec2b469e88773314660252274d9262fff63
[l2e.git] / src / common / TargetingMode.cpp
1 /*
2  * TargetingMode.cpp
3  *
4  *  Created on: Sep 9, 2012
5  *      Author: holy
6  */
7
8 #include "TargetingMode.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 common {
18
19 void TargetingMode::CreateTypeDescription() {
20         TargetingMode t;
21
22         TypeDescription &td(TypeDescription::Create(TYPE_ID, "TargetingMode"));
23         td.SetDescription("Specifies how selection of a target (e.g. for a spell) is performed.");
24         td.SetConstructor(&Construct);
25         td.SetSize(sizeof(TargetingMode));
26
27         td.AddField("faction", FieldDescription(((char *)&t.ally) - ((char *)&t), Interpreter::BOOLEAN_ID).SetDescription("targetted faction; true for ally, false for enemy"));
28         td.AddField("mode", FieldDescription(((char *)&t.mode) - ((char *)&t), Interpreter::NUMBER_ID).SetDescription("attack mode; 0 = all, 1 = multiple, 2 = single"));
29 }
30
31 void TargetingMode::Construct(void *data) {
32         new (data) TargetingMode;
33 }
34
35 }