4 * Created on: Aug 10, 2012
10 #include "../loader/TypeDescription.h"
12 using loader::FieldDescription;
13 using loader::TypeDescription;
18 : name(""), value(0), cost(0), status(false), battle(false) {
23 void Spell::CreateTypeDescription() {
26 int boolId(TypeDescription::GetTypeId("Boolean"));
27 int numberId(TypeDescription::GetTypeId("Number"));
28 int stringId(TypeDescription::GetTypeId("String"));
29 int targetsId(TypeDescription::GetTypeId("TargetingMode"));
31 TypeDescription &td(TypeDescription::CreateOrGet("Spell"));
32 td.SetConstructor(&Construct);
33 td.SetSize(sizeof(Spell));
35 td.AddField("name", FieldDescription(((char *)&s.name) - ((char *)&s), stringId, true));
36 td.AddField("cost", FieldDescription(((char *)&s.cost) - ((char *)&s), numberId, false));
37 td.AddField("targets", FieldDescription(((char *)&s.targetingMode) - ((char *)&s), targetsId, false));
38 td.AddField("status", FieldDescription(((char *)&s.status) - ((char *)&s), boolId, false));
39 td.AddField("battle", FieldDescription(((char *)&s.battle) - ((char *)&s), boolId, false));
42 void Spell::Construct(void *data) {