X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fcommon%2FSpell.cpp;fp=src%2Fcommon%2FSpell.cpp;h=907034645b76373b3961340614b988cc6007bbbe;hb=76bfe67c6f41be9c862213a3cba919e6c00955b0;hp=f347774317cfae7e70050df334b2c3a369a9f87d;hpb=06cdcf42d8f86955419bcf8ca3457f1d59a14707;p=l2e.git diff --git a/src/common/Spell.cpp b/src/common/Spell.cpp index f347774..9070346 100644 --- a/src/common/Spell.cpp +++ b/src/common/Spell.cpp @@ -7,6 +7,11 @@ #include "Spell.h" +#include "../loader/TypeDescription.h" + +using loader::FieldDescription; +using loader::TypeDescription; + namespace common { Spell::Spell() @@ -14,4 +19,21 @@ Spell::Spell() } + +void Spell::CreateTypeDescription() { + Spell s; + TypeDescription &td(TypeDescription::CreateOrGet("Spell")); + + td.SetSize(sizeof(Spell)); + + // TODO: flags + int numberId(TypeDescription::GetTypeId("Number")); + int stringId(TypeDescription::GetTypeId("String")); + int targetsId(TypeDescription::GetTypeId("TargetingMode")); + + td.AddField("name", FieldDescription(((char *)&s.name) - ((char *)&s), stringId, true)); + td.AddField("cost", FieldDescription(((char *)&s.cost) - ((char *)&s), numberId, false)); + td.AddField("targets", FieldDescription(((char *)&s.targetingMode) - ((char *)&s), targetsId, false)); +} + }