X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fcommon%2FIkari.cpp;h=3a023926b5fe8e5d94c9448c49ef03d61bda459c;hb=238da3a706448d4c592460684e2a5a2c0eb81a04;hp=fb3767e8a43be63a0a19321e95b3533a2186df38;hpb=0c01d2b65aaf159bfd9bcf9d3f909a1d2ae5247f;p=l2e.git diff --git a/src/common/Ikari.cpp b/src/common/Ikari.cpp index fb3767e..3a02392 100644 --- a/src/common/Ikari.cpp +++ b/src/common/Ikari.cpp @@ -7,12 +7,43 @@ #include "Ikari.h" +#include "../loader/TypeDescription.h" + +using loader::FieldDescription; +using loader::TypeDescription; + namespace common { Ikari::Ikari() : name("") -, cost(0) { +, cost(0) +, isPhysical(false) { + +} + + +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")); + 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).SetReferenced().SetDescription("the attack's name")); + td.AddField("cost", FieldDescription(((char *)&i.cost) - ((char *)&i), numberId).SetDescription("amount of ikari points needed and deducted for use")); + td.AddField("targets", FieldDescription(((char *)&i.targetingMode) - ((char *)&i), targetsId).SetDescription("how target selection is to be performed")); + td.AddField("type", FieldDescription(((char *)&i.isPhysical) - ((char *)&i), boolId).SetDescription("if the attack is physical (true) or magical(false)")); +} +void Ikari::Construct(void *data) { + new (data) Ikari; } }