From da79d51ad2158c1c47e682d01d5ea4a0975dd84c Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Wed, 4 Mar 2020 18:58:05 +0100 Subject: [PATCH] Added ScriptResolver C Interface. --- CInterface/Battling/ScriptResolver.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 CInterface/Battling/ScriptResolver.cpp diff --git a/CInterface/Battling/ScriptResolver.cpp b/CInterface/Battling/ScriptResolver.cpp new file mode 100644 index 0000000..606ecab --- /dev/null +++ b/CInterface/Battling/ScriptResolver.cpp @@ -0,0 +1,15 @@ +#include "../../src/Battling/ScriptHandling/ScriptResolver.hpp" +#define export extern "C" +using namespace CreatureLib::Battling; + +export ScriptResolver* CreatureLib_ScriptResolver_Construct() { return new ScriptResolver(); } + +export void CreatureLib_ScriptResolver_Destruct(const ScriptResolver* p) { delete p; } + +export void CreatureLib_ScriptResolver_Initialize(ScriptResolver* p, BattleLibrary* library) { + p->Initialize(library); +}; +export Script* CreatureLib_ScriptResolver_LoadScript(ScriptResolver* p, ScriptCategory category, + const char* scriptName) { + return p->LoadScript(category, ConstString(scriptName)); +};