X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fcommon%2FIkari.cpp;h=394d1718a25b019916b9cb0ecda51e5e226ef615;hb=3d69f521b593457304b282e5f23e36ab165288b6;hp=fb3767e8a43be63a0a19321e95b3533a2186df38;hpb=0c01d2b65aaf159bfd9bcf9d3f909a1d2ae5247f;p=l2e.git diff --git a/src/common/Ikari.cpp b/src/common/Ikari.cpp index fb3767e..394d171 100644 --- a/src/common/Ikari.cpp +++ b/src/common/Ikari.cpp @@ -1,18 +1,40 @@ -/* - * Ikari.cpp - * - * Created on: Aug 10, 2012 - * Author: holy - */ - #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; } }