#include "Spell.h"
+#include "../loader/TypeDescription.h"
+
+using loader::FieldDescription;
+using loader::TypeDescription;
+
namespace common {
Spell::Spell()
}
+
+void Spell::CreateTypeDescription() {
+ Spell s;
+
+ // TODO: flags
+ int numberId(TypeDescription::GetTypeId("Number"));
+ int stringId(TypeDescription::GetTypeId("String"));
+ int targetsId(TypeDescription::GetTypeId("TargetingMode"));
+
+ TypeDescription &td(TypeDescription::CreateOrGet("Spell"));
+ td.SetConstructor(&Construct);
+ td.SetSize(sizeof(Spell));
+
+ td.AddField("name", FieldDescription(((char *)&s.name) - ((char *)&s), stringId, true));
+ td.AddField("cost", FieldDescription(((char *)&s.cost) - ((char *)&s), numberId, false));
+ td.AddField("targets", FieldDescription(((char *)&s.targetingMode) - ((char *)&s), targetsId, false));
+}
+
+void Spell::Construct(void *data) {
+ new (data) Spell;
+}
+
}