C interface for BattleLibrary.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
6bffea953d
commit
ea8afcd0b3
|
@ -0,0 +1,25 @@
|
||||||
|
#include "../../src/Battling/Library/BattleLibrary.hpp"
|
||||||
|
#define export extern "C"
|
||||||
|
using namespace CreatureLib::Battling;
|
||||||
|
|
||||||
|
export const BattleLibrary* CreatureLib_BattleLibrary_Construct(const CreatureLib::Library::DataLibrary* staticLib,
|
||||||
|
BattleStatCalculator* statCalculator,
|
||||||
|
DamageLibrary* damageLibrary,
|
||||||
|
ExperienceLibrary* experienceLibrary,
|
||||||
|
ScriptResolver* scriptResolver,
|
||||||
|
MiscLibrary* miscLibrary) {
|
||||||
|
return new BattleLibrary(staticLib, statCalculator, damageLibrary, experienceLibrary, scriptResolver, miscLibrary);
|
||||||
|
}
|
||||||
|
|
||||||
|
export void CreatureLib_BattleLibrary_Destruct(const BattleLibrary* p) { delete p; }
|
||||||
|
|
||||||
|
#define SIMPLE_GET_FUNC(type, name, returnType) \
|
||||||
|
export returnType CreatureLib_##type##_##name(const type* p) { return p->name(); }
|
||||||
|
|
||||||
|
SIMPLE_GET_FUNC(BattleLibrary, GetStaticLib, const CreatureLib::Library::DataLibrary*);
|
||||||
|
SIMPLE_GET_FUNC(BattleLibrary, GetStatCalculator, const BattleStatCalculator*);
|
||||||
|
SIMPLE_GET_FUNC(BattleLibrary, GetDamageLibrary, const DamageLibrary*);
|
||||||
|
SIMPLE_GET_FUNC(BattleLibrary, GetMiscLibrary, const MiscLibrary*);
|
||||||
|
SIMPLE_GET_FUNC(BattleLibrary, GetExperienceLibrary, const ExperienceLibrary*);
|
||||||
|
|
||||||
|
#undef SIMPLE_GET_FUNC
|
|
@ -32,7 +32,7 @@ if (WINDOWS)
|
||||||
endif (WINDOWS)
|
endif (WINDOWS)
|
||||||
|
|
||||||
# Create Core library with files in src/Core
|
# Create Core library with files in src/Core
|
||||||
file(GLOB_RECURSE CORE_SRC_FILES "src/Core/*.cpp" "src/Core/*.hpp" "CInterface/Core/*.hpp")
|
file(GLOB_RECURSE CORE_SRC_FILES "src/Core/*.cpp" "src/Core/*.hpp" "CInterface/Core/*.cpp")
|
||||||
add_library(CreatureLibCore SHARED ${CORE_SRC_FILES})
|
add_library(CreatureLibCore SHARED ${CORE_SRC_FILES})
|
||||||
set_target_properties(CreatureLibCore PROPERTIES LINKER_LANGUAGE CXX)
|
set_target_properties(CreatureLibCore PROPERTIES LINKER_LANGUAGE CXX)
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ file(GLOB_RECURSE LIBRARY_SRC_FILES "src/Library/*.cpp" "src/Library/*.hpp" "CIn
|
||||||
add_library(CreatureLibLibrary SHARED ${LIBRARY_SRC_FILES})
|
add_library(CreatureLibLibrary SHARED ${LIBRARY_SRC_FILES})
|
||||||
|
|
||||||
# Create Battling library with files in src/Battling
|
# Create Battling library with files in src/Battling
|
||||||
file(GLOB_RECURSE BATTLING_SRC_FILES "src/Battling/*.cpp" "src/Battling/*.hpp" "CInterface/Battling/*.hpp")
|
file(GLOB_RECURSE BATTLING_SRC_FILES "src/Battling/*.cpp" "src/Battling/*.hpp" "CInterface/Battling/*.cpp")
|
||||||
add_library(CreatureLibBattling SHARED ${BATTLING_SRC_FILES})
|
add_library(CreatureLibBattling SHARED ${BATTLING_SRC_FILES})
|
||||||
|
|
||||||
if (NOT DEFINED CONAN_EXPORTED)
|
if (NOT DEFINED CONAN_EXPORTED)
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
using namespace CreatureLib::Battling;
|
using namespace CreatureLib::Battling;
|
||||||
|
|
||||||
BattleLibrary::BattleLibrary(CreatureLib::Library::DataLibrary* staticLib, BattleStatCalculator* statCalculator,
|
BattleLibrary::BattleLibrary(const CreatureLib::Library::DataLibrary* staticLib, BattleStatCalculator* statCalculator,
|
||||||
DamageLibrary* damageLibrary, ExperienceLibrary* experienceLibrary,
|
DamageLibrary* damageLibrary, ExperienceLibrary* experienceLibrary,
|
||||||
ScriptResolver* scriptResolver, MiscLibrary* miscLibrary)
|
ScriptResolver* scriptResolver, MiscLibrary* miscLibrary)
|
||||||
: _staticLib(staticLib), _statCalculator(statCalculator), _damageLibrary(damageLibrary),
|
: _staticLib(staticLib), _statCalculator(statCalculator), _damageLibrary(damageLibrary),
|
||||||
|
|
|
@ -19,7 +19,7 @@ namespace CreatureLib::Battling {
|
||||||
MiscLibrary* _miscLibrary = nullptr;
|
MiscLibrary* _miscLibrary = nullptr;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BattleLibrary(Library::DataLibrary* staticLib, BattleStatCalculator* statCalculator,
|
BattleLibrary(const Library::DataLibrary* staticLib, BattleStatCalculator* statCalculator,
|
||||||
DamageLibrary* damageLibrary, ExperienceLibrary* experienceLibrary,
|
DamageLibrary* damageLibrary, ExperienceLibrary* experienceLibrary,
|
||||||
ScriptResolver* scriptResolver, MiscLibrary* miscLibrary);
|
ScriptResolver* scriptResolver, MiscLibrary* miscLibrary);
|
||||||
~BattleLibrary();
|
~BattleLibrary();
|
||||||
|
|
Loading…
Reference in New Issue