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), usability(0) {
23 void Spell::CreateTypeDescription() {
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.SetSize(sizeof(Spell));
34 td.AddField("name", FieldDescription(((char *)&s.name) - ((char *)&s), stringId, true));
35 td.AddField("cost", FieldDescription(((char *)&s.cost) - ((char *)&s), numberId, false));
36 td.AddField("targets", FieldDescription(((char *)&s.targetingMode) - ((char *)&s), targetsId, false));