X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fcommon%2FIkari.cpp;h=394d1718a25b019916b9cb0ecda51e5e226ef615;hb=cc3d698b8c1ad09d7a3f9e3f28bc84e0ac1735ea;hp=6f7da0cd6ce77460771395783b18b31b9b966053;hpb=41983a2cd8dbbfe6adc02cdfccbf5c2887306e51;p=l2e.git diff --git a/src/common/Ikari.cpp b/src/common/Ikari.cpp index 6f7da0c..394d171 100644 --- a/src/common/Ikari.cpp +++ b/src/common/Ikari.cpp @@ -1,12 +1,13 @@ -/* - * 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() @@ -16,4 +17,24 @@ Ikari::Ikari() } + +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; +} + }