4 * Created on: Sep 9, 2012
8 #include "TargetingMode.h"
10 #include "../loader/TypeDescription.h"
12 using loader::FieldDescription;
13 using loader::TypeDescription;
17 void TargetingMode::CreateTypeDescription() {
20 int boolId(TypeDescription::GetTypeId("Boolean"));
21 int numberId(TypeDescription::GetTypeId("Number"));
23 TypeDescription &td(TypeDescription::CreateOrGet("TargetingMode"));
24 td.SetDescription("Specifies how selection of a target (e.g. for a spell) is performed.");
25 td.SetConstructor(&Construct);
26 td.SetSize(sizeof(TargetingMode));
28 td.AddField("faction", FieldDescription(((char *)&t.ally) - ((char *)&t), boolId).SetDescription("targetted faction; true for ally, false for enemy"));
29 td.AddField("mode", FieldDescription(((char *)&t.mode) - ((char *)&t), numberId).SetDescription("attack mode; 0 = all, 1 = multiple, 2 = single"));
32 void TargetingMode::Construct(void *data) {
33 new (data) TargetingMode;