X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcommon%2FIkari.cpp;h=e4321497a4663f586013cb9799efd7fd37e77105;hb=1907ca03c5e865c4d398170042aa384c67ffff29;hp=fb3767e8a43be63a0a19321e95b3533a2186df38;hpb=0c01d2b65aaf159bfd9bcf9d3f909a1d2ae5247f;p=l2e.git diff --git a/src/common/Ikari.cpp b/src/common/Ikari.cpp index fb3767e..e432149 100644 --- a/src/common/Ikari.cpp +++ b/src/common/Ikari.cpp @@ -7,12 +7,41 @@ #include "Ikari.h" +#include "TargetingMode.h" +#include "../loader/Interpreter.h" +#include "../loader/TypeDescription.h" + +using loader::FieldDescription; +using loader::Interpreter; +using loader::TypeDescription; + namespace common { Ikari::Ikari() : name("") -, cost(0) { +, cost(0) +, isPhysical(false) { + +} + + +void Ikari::CreateTypeDescription() { + Ikari i; + + TypeDescription &td(TypeDescription::Create(TYPE_ID, "Ikari")); + td.SetDescription( + "Information of a single ikari attack."); + td.SetConstructor(&Construct); + td.SetSize(sizeof(Ikari)); + + td.AddField("name", FieldDescription(((char *)&i.name) - ((char *)&i), Interpreter::STRING_ID).SetReferenced().SetDescription("the attack's name")); + td.AddField("cost", FieldDescription(((char *)&i.cost) - ((char *)&i), Interpreter::NUMBER_ID).SetDescription("amount of ikari points needed and deducted for use")); + td.AddField("targets", FieldDescription(((char *)&i.targetingMode) - ((char *)&i), TargetingMode::TYPE_ID).SetDescription("how target selection is to be performed")); + td.AddField("type", FieldDescription(((char *)&i.isPhysical) - ((char *)&i), Interpreter::BOOLEAN_ID).SetDescription("if the attack is physical (true) or magical(false)")); +} +void Ikari::Construct(void *data) { + new (data) Ikari; } }