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 spriteId(TypeDescription::GetTypeId("Sprite"));
42 int stringId(TypeDescription::GetTypeId("String"));
43 int targetsId(TypeDescription::GetTypeId("TargetingMode"));
45 td.AddField("name", FieldDescription(((char *)&i.name) - ((char *)&i), stringId, true));
46 td.AddField("menuicon", FieldDescription(((char *)&i.menuIcon) - ((char *)&i), spriteId, true));
47 // TODO: implement flags/fields (e.g. for usability)
48 td.AddField("targets", FieldDescription(((char *)&i.targettingMode) - ((char *)&i), targetsId, false));
49 td.AddField("ikari", FieldDescription(((char *)&i.ikari) - ((char *)&i), ikariId, true));
50 td.AddField("attackanimation", FieldDescription(((char *)&i.attackAnimation) - ((char *)&i), animationId, true));