+
+void Monster::CreateTypeDescription() {
+ Monster m;
+
+ int animationId(TypeDescription::GetTypeId("Animation"));
+ int numberId(TypeDescription::GetTypeId("Number"));
+ int spriteId(TypeDescription::GetTypeId("Sprite"));
+ int statsId(TypeDescription::GetTypeId("Stats"));
+ int stringId(TypeDescription::GetTypeId("String"));
+
+ TypeDescription &td(TypeDescription::CreateOrGet("Monster"));
+ td.SetDescription("All data of a monster.");
+ td.SetConstructor(&Construct);
+ td.SetSize(sizeof(Monster));
+
+ td.AddField("name", FieldDescription(((char *)&m.name) - ((char *)&m), stringId).SetReferenced());
+ td.AddField("sprite", FieldDescription(((char *)&m.sprite) - ((char *)&m), spriteId).SetReferenced());
+ td.AddField("level", FieldDescription(((char *)&m.level) - ((char *)&m), numberId));
+
+ td.AddField("maxHealth", FieldDescription(((char *)&m.maxHealth) - ((char *)&m), numberId));
+ td.AddField("health", FieldDescription(((char *)&m.health) - ((char *)&m), numberId));
+ td.AddField("maxMana", FieldDescription(((char *)&m.maxMana) - ((char *)&m), numberId));
+ td.AddField("mana", FieldDescription(((char *)&m.mana) - ((char *)&m), numberId));
+ td.AddField("stats", FieldDescription(((char *)&m.stats) - ((char *)&m), statsId));
+
+ td.AddField("attackAnimation", FieldDescription(((char *)&m.attackAnimation) - ((char *)&m), animationId).SetReferenced());
+ td.AddField("spellAnimation", FieldDescription(((char *)&m.spellAnimation) - ((char *)&m), animationId).SetReferenced());
+ td.AddField("meleeAnimation", FieldDescription(((char *)&m.meleeAnimation) - ((char *)&m), animationId).SetReferenced());
+}
+
+void Monster::Construct(void *data) {
+ new (data) Monster;
+}
+