Added C interface for EventData.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
19
CInterface/Battling/EventData.cpp
Normal file
19
CInterface/Battling/EventData.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include "../../src/Battling/EventHooks/EventData.hpp"
|
||||
#define export extern "C"
|
||||
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(); }
|
||||
|
||||
SIMPLE_GET_FUNC(EventData, GetKind, EventDataKind);
|
||||
|
||||
SIMPLE_GET_FUNC(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(HealEvent, GetCreature, Creature*);
|
||||
SIMPLE_GET_FUNC(HealEvent, GetOriginalHealth, uint32_t);
|
||||
SIMPLE_GET_FUNC(HealEvent, GetNewHealth, uint32_t);
|
||||
Reference in New Issue
Block a user