1 #include "TargetingMode.h"
3 #include "../loader/Interpreter.h"
4 #include "../loader/TypeDescription.h"
6 using loader::FieldDescription;
7 using loader::Interpreter;
8 using loader::TypeDescription;
12 void TargetingMode::CreateTypeDescription() {
15 TypeDescription &td(TypeDescription::Create(TYPE_ID, "TargetingMode"));
16 td.SetDescription("Specifies how selection of a target (e.g. for a spell) is performed.");
17 td.SetConstructor(&Construct);
18 td.SetSize(sizeof(TargetingMode));
20 td.AddField("faction", FieldDescription(((char *)&t.ally) - ((char *)&t), Interpreter::BOOLEAN_ID).SetDescription("targetted faction; true for ally, false for enemy"));
21 td.AddField("mode", FieldDescription(((char *)&t.mode) - ((char *)&t), Interpreter::NUMBER_ID).SetDescription("attack mode; 0 = all, 1 = multiple, 2 = single"));
24 void TargetingMode::Construct(void *data) {
25 new (data) TargetingMode;