#include "Ikari.h"
+#include "../loader/TypeDescription.h"
+
+using loader::FieldDescription;
+using loader::TypeDescription;
+
namespace common {
Ikari::Ikari()
}
+
+void Ikari::CreateTypeDescription() {
+ Ikari i;
+ TypeDescription &td(TypeDescription::CreateOrGet("Ikari"));
+
+ td.SetSize(sizeof(Ikari));
+
+ int boolId(TypeDescription::GetTypeId("Boolean"));
+ int numberId(TypeDescription::GetTypeId("Number")); // FIXME: need small number type
+ int stringId(TypeDescription::GetTypeId("String"));
+ int targetsId(TypeDescription::GetTypeId("TargetingMode"));
+
+ td.AddField("name", FieldDescription(((char *)&i.name) - ((char *)&i), stringId, true));
+ td.AddField("cost", FieldDescription(((char *)&i.cost) - ((char *)&i), numberId, false));
+ td.AddField("targets", FieldDescription(((char *)&i.targetingMode) - ((char *)&i), targetsId, false));
+ td.AddField("physical", FieldDescription(((char *)&i.isPhysical) - ((char *)&i), boolId, true));
+}
+
}
void SetMagical() { isPhysical = false; }
void SetPhysical() { isPhysical = true; }
+ static void CreateTypeDescription();
+
private:
const char *name;
- Uint8 cost;
+ int cost;
TargetingMode targetingMode;
bool isPhysical;