X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fcommon%2FSpell.cpp;h=4fce398bdaf16e534c702736b1d12d101f0362f9;hb=3565d69c463c39b05b4612ca3d3557139d91e310;hp=a0b3b9de82d514f679ff01daba8bccacd561b95f;hpb=46d158b25b842d2ec4b9734af09ca6006c934498;p=l2e.git diff --git a/src/common/Spell.cpp b/src/common/Spell.cpp index a0b3b9d..4fce398 100644 --- a/src/common/Spell.cpp +++ b/src/common/Spell.cpp @@ -15,7 +15,7 @@ using loader::TypeDescription; namespace common { Spell::Spell() -: name(""), value(0), cost(0), usability(0) { +: name(""), value(0), cost(0), status(false), battle(false) { } @@ -23,17 +23,24 @@ Spell::Spell() void Spell::CreateTypeDescription() { Spell s; - // TODO: flags + 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")); + td.SetConstructor(&Construct); td.SetSize(sizeof(Spell)); td.AddField("name", FieldDescription(((char *)&s.name) - ((char *)&s), stringId, true)); td.AddField("cost", FieldDescription(((char *)&s.cost) - ((char *)&s), numberId, false)); td.AddField("targets", FieldDescription(((char *)&s.targetingMode) - ((char *)&s), targetsId, false)); + td.AddField("status", FieldDescription(((char *)&s.status) - ((char *)&s), boolId, false)); + td.AddField("battle", FieldDescription(((char *)&s.battle) - ((char *)&s), boolId, false)); +} + +void Spell::Construct(void *data) { + new (data) Spell; } }