X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcommon%2FSpell.cpp;h=4fce22f1e42ea3e15992b969a952c8296cd9ee60;hb=1907ca03c5e865c4d398170042aa384c67ffff29;hp=bcf7f2948aaf1b0579502d052f2c2d3dd8ab63fd;hpb=fb9bd716a1740e41efbb08a3bfa42e441d64c693;p=l2e.git diff --git a/src/common/Spell.cpp b/src/common/Spell.cpp index bcf7f29..4fce22f 100644 --- a/src/common/Spell.cpp +++ b/src/common/Spell.cpp @@ -7,9 +7,12 @@ #include "Spell.h" +#include "TargetingMode.h" +#include "../loader/Interpreter.h" #include "../loader/TypeDescription.h" using loader::FieldDescription; +using loader::Interpreter; using loader::TypeDescription; namespace common { @@ -23,21 +26,16 @@ Spell::Spell() void Spell::CreateTypeDescription() { Spell s; - int boolId(TypeDescription::GetTypeId("Boolean")); - int numberId(TypeDescription::GetTypeId("Number")); - int stringId(TypeDescription::GetTypeId("String")); - int targetsId(TypeDescription::GetTypeId("TargetingMode")); - - TypeDescription &td(TypeDescription::CreateOrGet("Spell")); + TypeDescription &td(TypeDescription::Create(TYPE_ID, "Spell")); td.SetDescription("All data about a spell (soon)."); td.SetConstructor(&Construct); td.SetSize(sizeof(Spell)); - td.AddField("name", FieldDescription(((char *)&s.name) - ((char *)&s), stringId).SetReferenced().SetDescription("the spell's name")); - td.AddField("cost", FieldDescription(((char *)&s.cost) - ((char *)&s), numberId).SetDescription("Amount of magic points needed and deducted for invocation")); - td.AddField("targets", FieldDescription(((char *)&s.targetingMode) - ((char *)&s), targetsId).SetDescription("how target selection is to be performed")); - td.AddField("status", FieldDescription(((char *)&s.status) - ((char *)&s), boolId).SetDescription("if the spell can be used at the status screen")); - td.AddField("battle", FieldDescription(((char *)&s.battle) - ((char *)&s), boolId).SetDescription("if the spell can be used in battle")); + td.AddField("name", FieldDescription(((char *)&s.name) - ((char *)&s), Interpreter::STRING_ID).SetReferenced().SetDescription("the spell's name")); + td.AddField("cost", FieldDescription(((char *)&s.cost) - ((char *)&s), Interpreter::NUMBER_ID).SetDescription("Amount of magic points needed and deducted for invocation")); + td.AddField("targets", FieldDescription(((char *)&s.targetingMode) - ((char *)&s), TargetingMode::TYPE_ID).SetDescription("how target selection is to be performed")); + td.AddField("status", FieldDescription(((char *)&s.status) - ((char *)&s), Interpreter::BOOLEAN_ID).SetDescription("if the spell can be used at the status screen")); + td.AddField("battle", FieldDescription(((char *)&s.battle) - ((char *)&s), Interpreter::BOOLEAN_ID).SetDescription("if the spell can be used in battle")); } void Spell::Construct(void *data) {