4 * Created on: Aug 9, 2012
10 #include "../loader/TypeDescription.h"
12 using loader::FieldDescription;
13 using loader::TypeDescription;
33 void Item::CreateTypeDescription() {
35 TypeDescription &td(TypeDescription::CreateOrGet("Item"));
37 td.SetSize(sizeof(Item));
39 int animationId(TypeDescription::GetTypeId("Animation"));
40 int ikariId(TypeDescription::GetTypeId("Ikari"));
41 int numberId(TypeDescription::GetTypeId("Number"));
42 int spriteId(TypeDescription::GetTypeId("Sprite"));
43 int stringId(TypeDescription::GetTypeId("String"));
44 int targetsId(TypeDescription::GetTypeId("TargetingMode"));
46 td.AddField("name", FieldDescription(((char *)&i.name) - ((char *)&i), stringId, true));
47 td.AddField("menuicon", FieldDescription(((char *)&i.menuIcon) - ((char *)&i), spriteId, true));
48 // TODO: implement flags/fields (e.g. for usability)
49 td.AddField("targets", FieldDescription(((char *)&i.targettingMode) - ((char *)&i), targetsId, false));
50 td.AddField("ikari", FieldDescription(((char *)&i.ikari) - ((char *)&i), ikariId, true));
51 td.AddField("attackanimation", FieldDescription(((char *)&i.attackAnimation) - ((char *)&i), animationId, true));