CreatureLib/CInterface/Library/DataLibrary.cpp

23 lines
1.2 KiB
C++
Raw Normal View History

2020-02-29 13:09:03 +00:00
#include "../../src/Library/DataLibrary.hpp"
#include "../Core.hpp"
using namespace CreatureLib::Library;
2020-02-29 13:09:03 +00:00
export uint8_t CreatureLib_DataLibrary_Construct(const DataLibrary*& out, LibrarySettings* settings,
SpeciesLibrary* species, AttackLibrary* attacks, ItemLibrary* items,
GrowthRateLibrary* growthRates, TypeLibrary* typeLibrary) {
Try(out = new DataLibrary(settings, species, attacks, items, growthRates, typeLibrary);)
2020-02-29 13:09:03 +00:00
}
export void CreatureLib_DataLibrary_Destruct(const DataLibrary* p) { delete p; }
2020-02-29 13:09:03 +00:00
#define SIMPLE_GET_FUNC(type, name, returnType) \
2020-05-24 17:01:47 +00:00
export returnType CreatureLib_##type##_##name(const type* p) { return p->name().operator->(); }
2020-02-29 13:09:03 +00:00
SIMPLE_GET_FUNC(DataLibrary, GetSettings, const LibrarySettings*);
SIMPLE_GET_FUNC(DataLibrary, GetSpeciesLibrary, const SpeciesLibrary*);
SIMPLE_GET_FUNC(DataLibrary, GetAttackLibrary, const AttackLibrary*);
SIMPLE_GET_FUNC(DataLibrary, GetItemLibrary, const ItemLibrary*);
SIMPLE_GET_FUNC(DataLibrary, GetGrowthRates, const GrowthRateLibrary*);
SIMPLE_GET_FUNC(DataLibrary, GetTypeLibrary, const TypeLibrary*);
2020-02-29 13:09:03 +00:00
#undef SIMPLE_GET_FUNC