23 lines
1.4 KiB
C++
23 lines
1.4 KiB
C++
|
#include "../../src/Library/DataLibrary.hpp"
|
||
|
#define export extern "C"
|
||
|
|
||
|
export const CreatureLib::Library::DataLibrary* CreatureLib_DataLibrary_Construct(
|
||
|
CreatureLib::Library::LibrarySettings* settings, CreatureLib::Library::SpeciesLibrary* species,
|
||
|
CreatureLib::Library::AttackLibrary* attacks, CreatureLib::Library::ItemLibrary* items,
|
||
|
CreatureLib::Library::GrowthRateLibrary* growthRates, CreatureLib::Library::TypeLibrary* typeLibrary) {
|
||
|
return new CreatureLib::Library::DataLibrary(settings, species, attacks, items, growthRates, typeLibrary);
|
||
|
}
|
||
|
|
||
|
export void CreatureLib_DataLibrary_Destruct(const CreatureLib::Library::DataLibrary* p) { delete p; }
|
||
|
|
||
|
#define SIMPLE_GET_FUNC(type, name, returnType) \
|
||
|
export returnType CreatureLib_##type##_##name(const CreatureLib::Library::type* p) { return p->name(); }
|
||
|
|
||
|
SIMPLE_GET_FUNC(DataLibrary, GetSettings, const CreatureLib::Library::LibrarySettings*);
|
||
|
SIMPLE_GET_FUNC(DataLibrary, GetSpeciesLibrary, const CreatureLib::Library::SpeciesLibrary*);
|
||
|
SIMPLE_GET_FUNC(DataLibrary, GetAttackLibrary, const CreatureLib::Library::AttackLibrary*);
|
||
|
SIMPLE_GET_FUNC(DataLibrary, GetItemLibrary, const CreatureLib::Library::ItemLibrary*);
|
||
|
SIMPLE_GET_FUNC(DataLibrary, GetGrowthRates, const CreatureLib::Library::GrowthRateLibrary*);
|
||
|
SIMPLE_GET_FUNC(DataLibrary, GetTypeLibrary, const CreatureLib::Library::TypeLibrary*);
|
||
|
|
||
|
#undef SIMPLE_GET_FUNC
|