#include "Monster.h"
+#include "../loader/TypeDescription.h"
+
+using loader::FieldDescription;
+using loader::TypeDescription;
+
namespace battle {
Monster::Monster()
}
}
+
+void Monster::CreateTypeDescription() {
+ Monster m;
+ TypeDescription &td(TypeDescription::CreateOrGet("Monster"));
+
+ td.SetSize(sizeof(Monster));
+
+ 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"));
+
+ td.AddField("name", FieldDescription(((char *)&m.name) - ((char *)&m), stringId, true));
+ td.AddField("sprite", FieldDescription(((char *)&m.sprite) - ((char *)&m), spriteId, true));
+ td.AddField("level", FieldDescription(((char *)&m.level) - ((char *)&m), numberId, false));
+
+ td.AddField("maxHealth", FieldDescription(((char *)&m.maxHealth) - ((char *)&m), numberId, false));
+ td.AddField("health", FieldDescription(((char *)&m.health) - ((char *)&m), numberId, false));
+ td.AddField("maxMana", FieldDescription(((char *)&m.maxMana) - ((char *)&m), numberId, false));
+ td.AddField("mana", FieldDescription(((char *)&m.mana) - ((char *)&m), numberId, false));
+ td.AddField("stats", FieldDescription(((char *)&m.stats) - ((char *)&m), statsId, false));
+
+ td.AddField("attackAnimation", FieldDescription(((char *)&m.attackAnimation) - ((char *)&m), animationId, true));
+ td.AddField("spellAnimation", FieldDescription(((char *)&m.spellAnimation) - ((char *)&m), animationId, true));
+ td.AddField("meleeAnimation", FieldDescription(((char *)&m.meleeAnimation) - ((char *)&m), animationId, true));
+}
+
}