From 985c2720c5a259cd9fd7f10ff8ddcaa04d730260 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Wed, 4 Mar 2020 19:18:47 +0100 Subject: [PATCH] Added MiscLibrary C Interface. --- CInterface/Battling/MiscLibrary.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 CInterface/Battling/MiscLibrary.cpp diff --git a/CInterface/Battling/MiscLibrary.cpp b/CInterface/Battling/MiscLibrary.cpp new file mode 100644 index 0000000..75e45df --- /dev/null +++ b/CInterface/Battling/MiscLibrary.cpp @@ -0,0 +1,12 @@ +#include "../../src/Battling/Library/MiscLibrary.hpp" +#define export extern "C" +using namespace CreatureLib::Battling; + +export MiscLibrary* CreatureLib_MiscLibrary_Construct() { return new MiscLibrary(); } + +export void CreatureLib_MiscLibrary_Destruct(const MiscLibrary* p) { delete p; } + +export void CreatureLib_MiscLibrary_IsCritical(MiscLibrary* p, ExecutingAttack* attack, Creature* target, uint8_t hit) { + p->IsCritical(attack, target, hit); +}; +export void CreatureLib_MiscLibrary_CanFlee(MiscLibrary* p, FleeTurnChoice* switchChoice) { p->CanFlee(switchChoice); }; \ No newline at end of file