4 * Created on: Sep 9, 2012
8 #include "TargetingMode.h"
10 #include "../loader/Interpreter.h"
11 #include "../loader/TypeDescription.h"
13 using loader::FieldDescription;
14 using loader::Interpreter;
15 using loader::TypeDescription;
19 void TargetingMode::CreateTypeDescription() {
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));
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"));
31 void TargetingMode::Construct(void *data) {
32 new (data) TargetingMode;