Added DamageLibrary C Interface.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-03-04 18:50:16 +01:00
parent e7d3c6afd4
commit 679133ef4f
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
1 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,21 @@
#include "../../src/Battling/Library/DamageLibrary.hpp"
#define export extern "C"
using namespace CreatureLib::Battling;
export const DamageLibrary* CreatureLib_DamageLibrary_Construct() { return new DamageLibrary(); }
export void CreatureLib_DamageLibrary_Destruct(const DamageLibrary* p) { delete p; }
export uint32_t GetDamage(const DamageLibrary* p, ExecutingAttack* attack, Creature* target, uint8_t hitIndex) {
return p->GetDamage(attack, target, hitIndex);
}
export uint8_t GetBasePower(const DamageLibrary* p, ExecutingAttack* attack, Creature* target, uint8_t hitIndex) {
return p->GetBasePower(attack, target, hitIndex);
}
export float GetStatModifier(const DamageLibrary* p, ExecutingAttack* attack, Creature* target, uint8_t hitIndex) {
return p->GetStatModifier(attack, target, hitIndex);
}
export float GetDamageModifier(const DamageLibrary* p, ExecutingAttack* attack, Creature* target, uint8_t hitIndex) {
return p->GetDamageModifier(attack, target, hitIndex);
}