]> git.localhorst.tv Git - l2e.git/blobdiff - src/common/Item.cpp
fixed some issues to get it to compile again
[l2e.git] / src / common / Item.cpp
index be22c6e77e3d7697a42f3fbd6c0cebd7180768ef..1b54c9a2ac73eef37a0278f64e32bee9b7d72d30 100644 (file)
@@ -7,6 +7,11 @@
 
 #include "Item.h"
 
+#include "../loader/TypeDescription.h"
+
+using loader::FieldDescription;
+using loader::TypeDescription;
+
 namespace common {
 
 Item::Item()
@@ -14,6 +19,7 @@ Item::Item()
 , menuIcon(0)
 , chestIcon(0)
 , ikari(0)
+, attackAnimation(0)
 
 , value(0)
 , properties(0)
@@ -23,4 +29,25 @@ Item::Item()
 
 }
 
+
+void Item::CreateTypeDescription() {
+       Item i;
+       TypeDescription &td(TypeDescription::CreateOrGet("Item"));
+
+       td.SetSize(sizeof(Item));
+
+       int animationId(TypeDescription::GetTypeId("Animation"));
+       int ikariId(TypeDescription::GetTypeId("Ikari"));
+       int spriteId(TypeDescription::GetTypeId("Sprite"));
+       int stringId(TypeDescription::GetTypeId("String"));
+       int targetsId(TypeDescription::GetTypeId("TargetingMode"));
+
+       td.AddField("name", FieldDescription(((char *)&i.name) - ((char *)&i), stringId, true));
+       td.AddField("menuicon", FieldDescription(((char *)&i.menuIcon) - ((char *)&i), spriteId, true));
+       // TODO: implement flags/fields (e.g. for usability)
+       td.AddField("targets", FieldDescription(((char *)&i.targettingMode) - ((char *)&i), targetsId, false));
+       td.AddField("ikari", FieldDescription(((char *)&i.ikari) - ((char *)&i), ikariId, true));
+       td.AddField("attackanimation", FieldDescription(((char *)&i.attackAnimation) - ((char *)&i), animationId, true));
+}
+
 }