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.SetDescription("All data of an item (soon).");
52 td.SetConstructor(&Construct);
53 td.SetSize(sizeof(Item));
55 td.AddField("name", FieldDescription(((char *)&i.name) - ((char *)&i), stringId).SetReferenced().SetDescription("the item's name"));
56 td.AddField("menuicon", FieldDescription(((char *)&i.menuIcon) - ((char *)&i), spriteId).SetReferenced().SetDescription("icon that is displayed in menus"));
58 td.AddField("mostUseful", FieldDescription(((char *)&i.mostUseful) - ((char *)&i), boolId));
59 td.AddField("equipable", FieldDescription(((char *)&i.equipable) - ((char *)&i), boolId));
60 td.AddField("cursed", FieldDescription(((char *)&i.cursed) - ((char *)&i), boolId));
61 td.AddField("fruit", FieldDescription(((char *)&i.fruit) - ((char *)&i), boolId));
62 td.AddField("scenario", FieldDescription(((char *)&i.scenario) - ((char *)&i), boolId));
63 td.AddField("status", FieldDescription(((char *)&i.status) - ((char *)&i), boolId));
64 td.AddField("battle", FieldDescription(((char *)&i.battle) - ((char *)&i), boolId).SetDescription("if the item can be used in battle"));
66 td.AddField("targets", FieldDescription(((char *)&i.targettingMode) - ((char *)&i), targetsId).SetDescription("how target selection is to be performed"));
67 td.AddField("ikari", FieldDescription(((char *)&i.ikari) - ((char *)&i), ikariId).SetReferenced().SetDescription("ikari attack of the item (sensible only for equipment)"));
68 td.AddField("attackanimation", FieldDescription(((char *)&i.attackAnimation) - ((char *)&i), animationId).SetReferenced().SetDescription("animation that is run when the item is used for attacking"));
71 void Item::Construct(void *data) {