4 * Created on: Aug 9, 2012
10 #include "../loader/TypeDescription.h"
12 using loader::FieldDescription;
13 using loader::TypeDescription;
40 void Item::CreateTypeDescription() {
43 int animationId(TypeDescription::GetTypeId("Animation"));
44 int boolId(TypeDescription::GetTypeId("Boolean"));
45 int ikariId(TypeDescription::GetTypeId("Ikari"));
46 int spriteId(TypeDescription::GetTypeId("Sprite"));
47 int stringId(TypeDescription::GetTypeId("String"));
48 int targetsId(TypeDescription::GetTypeId("TargetingMode"));
50 TypeDescription &td(TypeDescription::CreateOrGet("Item"));
51 td.SetConstructor(&Construct);
52 td.SetSize(sizeof(Item));
54 td.AddField("name", FieldDescription(((char *)&i.name) - ((char *)&i), stringId, true));
55 td.AddField("menuicon", FieldDescription(((char *)&i.menuIcon) - ((char *)&i), spriteId, true));
57 td.AddField("mostUseful", FieldDescription(((char *)&i.mostUseful) - ((char *)&i), boolId, false));
58 td.AddField("equipable", FieldDescription(((char *)&i.equipable) - ((char *)&i), boolId, false));
59 td.AddField("cursed", FieldDescription(((char *)&i.cursed) - ((char *)&i), boolId, false));
60 td.AddField("fruit", FieldDescription(((char *)&i.fruit) - ((char *)&i), boolId, false));
61 td.AddField("scenario", FieldDescription(((char *)&i.scenario) - ((char *)&i), boolId, false));
62 td.AddField("status", FieldDescription(((char *)&i.status) - ((char *)&i), boolId, false));
63 td.AddField("battle", FieldDescription(((char *)&i.battle) - ((char *)&i), boolId, false));
65 td.AddField("targets", FieldDescription(((char *)&i.targettingMode) - ((char *)&i), targetsId, false));
66 td.AddField("ikari", FieldDescription(((char *)&i.ikari) - ((char *)&i), ikariId, true));
67 td.AddField("attackanimation", FieldDescription(((char *)&i.attackAnimation) - ((char *)&i), animationId, true));
70 void Item::Construct(void *data) {