#include "Stats.h"
+#include "../loader/TypeDescription.h"
+
+using loader::FieldDescription;
+using loader::TypeDescription;
+
namespace battle {
Stats::Stats()
}
+
+void Stats::CreateTypeDescription() {
+ Stats s;
+ TypeDescription &td(TypeDescription::CreateOrGet("Stats"));
+
+ td.SetSize(sizeof(Stats));
+
+ int numberId(TypeDescription::GetTypeId("Number"));
+
+ td.AddField("atp", FieldDescription(((char *)&s.attack) - ((char *)&s), numberId, false));
+ td.AddField("dfp", FieldDescription(((char *)&s.defense) - ((char *)&s), numberId, false));
+ td.AddField("str", FieldDescription(((char *)&s.strength) - ((char *)&s), numberId, false));
+ td.AddField("agl", FieldDescription(((char *)&s.agility) - ((char *)&s), numberId, false));
+ td.AddField("int", FieldDescription(((char *)&s.intelligence) - ((char *)&s), numberId, false));
+ td.AddField("gut", FieldDescription(((char *)&s.gut) - ((char *)&s), numberId, false));
+ td.AddField("mgr", FieldDescription(((char *)&s.magicResistance) - ((char *)&s), numberId, false));
+}
+
}
void SetGut(Uint8 g) { gut = g; }
void SetMagicResistance(Uint16 m) { magicResistance = m; }
+ static void CreateTypeDescription();
+
private:
- Uint16 attack;
- Uint16 defense;
- Uint16 strength;
- Uint16 agility;
- Uint16 intelligence;
- Uint16 magicResistance;
- Uint8 gut;
+ int attack;
+ int defense;
+ int strength;
+ int agility;
+ int intelligence;
+ int magicResistance;
+ int gut;
};