#include "../../src/Battling/EventHooks/EventData.hpp" #include "../Core.hpp" using namespace CreatureLib::Battling; export void CreatureLib_EventData_Destruct(const EventData* p) { delete p; } #define SIMPLE_GET_FUNC(type, name, returnType) \ export returnType CreatureLib_##type##_##name(const type* p) { return p->name(); } #define SIMPLE_GET_FUNC_SMART_PTR(type, name, returnType) \ export returnType CreatureLib_##type##_##name(const type* p) { return p->name().operator->(); } SIMPLE_GET_FUNC(EventData, GetKind, EventDataKind); SIMPLE_GET_FUNC_SMART_PTR(DamageEvent, GetCreature, Creature*); SIMPLE_GET_FUNC(DamageEvent, GetDamageSource, DamageSource); SIMPLE_GET_FUNC(DamageEvent, GetOriginalHealth, uint32_t); SIMPLE_GET_FUNC(DamageEvent, GetNewHealth, uint32_t); SIMPLE_GET_FUNC_SMART_PTR(HealEvent, GetCreature, Creature*); SIMPLE_GET_FUNC(HealEvent, GetOriginalHealth, uint32_t); SIMPLE_GET_FUNC(HealEvent, GetNewHealth, uint32_t); SIMPLE_GET_FUNC_SMART_PTR(FaintEvent, GetCreature, Creature*); export const char* CreatureLib_DisplayTextEvent_GetText(const DisplayTextEvent* p) { return p->GetText().c_str(); } #undef SIMPLE_GET_FUNC #undef SIMPLE_GET_FUNC_SMART_PTR