From 7f197b05a3e4217cd60b262573afdc2d01d51157 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Wed, 4 Mar 2020 18:11:08 +0100 Subject: [PATCH] C interface for Battle Stat Calculator. --- CInterface/Battling/BattleStatCalculator.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 CInterface/Battling/BattleStatCalculator.cpp diff --git a/CInterface/Battling/BattleStatCalculator.cpp b/CInterface/Battling/BattleStatCalculator.cpp new file mode 100644 index 0000000..5f83c1b --- /dev/null +++ b/CInterface/Battling/BattleStatCalculator.cpp @@ -0,0 +1,16 @@ +#include "../../src/Battling/Library/BattleStatCalculator.hpp" +#define export extern "C" +using namespace CreatureLib::Battling; + +export const BattleStatCalculator* CreatureLib_BattleStatCalculator_Construct() { return new BattleStatCalculator(); } + +export void CreatureLib_BattleStatCalculator_Destruct(const BattleStatCalculator* p) { delete p; } + +export uint32_t CreatureLib_BattleStatCalculator_CalculateFlatStat(const BattleStatCalculator* p, Creature* creature, + CreatureLib::Core::Statistic stat) { + return p->CalculateFlatStat(creature, stat); +} +export uint32_t CreatureLib_BattleStatCalculator_CalculateBoostedStat(const BattleStatCalculator* p, Creature* creature, + CreatureLib::Core::Statistic stat) { + return p->CalculateBoostedStat(creature, stat); +} \ No newline at end of file