X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fcommon%2FIkari.cpp;h=394d1718a25b019916b9cb0ecda51e5e226ef615;hb=ec25171b0b27999eb126e2144dae1e35f271b945;hp=3e7c79fced415f74b76f708377f1bce280eec4a1;hpb=46d158b25b842d2ec4b9734af09ca6006c934498;p=l2e.git diff --git a/src/common/Ikari.cpp b/src/common/Ikari.cpp index 3e7c79f..394d171 100644 --- a/src/common/Ikari.cpp +++ b/src/common/Ikari.cpp @@ -1,15 +1,11 @@ -/* - * 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 { @@ -25,18 +21,20 @@ Ikari::Ikari() void Ikari::CreateTypeDescription() { Ikari i; - int boolId(TypeDescription::GetTypeId("Boolean")); - int numberId(TypeDescription::GetTypeId("Number")); // FIXME: need small number type - int stringId(TypeDescription::GetTypeId("String")); - int targetsId(TypeDescription::GetTypeId("TargetingMode")); - - TypeDescription &td(TypeDescription::CreateOrGet("Ikari")); + 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), stringId, true)); - td.AddField("cost", FieldDescription(((char *)&i.cost) - ((char *)&i), numberId, false)); - td.AddField("targets", FieldDescription(((char *)&i.targetingMode) - ((char *)&i), targetsId, false)); - td.AddField("physical", FieldDescription(((char *)&i.isPhysical) - ((char *)&i), boolId, true)); + 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; } }