34 lines
1.5 KiB
C++
34 lines
1.5 KiB
C++
#include "../../src/Library/TypeLibrary.hpp"
|
|
#include "../Core.hpp"
|
|
using namespace CreatureLib::Library;
|
|
|
|
export_func TypeLibrary* CreatureLib_TypeLibrary_Construct(size_t initialCapacity) {
|
|
return new TypeLibrary(initialCapacity);
|
|
};
|
|
|
|
export_func void CreatureLib_TypeLibrary_Destruct(const TypeLibrary* p) { delete p; }
|
|
|
|
export_func u8 CreatureLib_TypeLibrary_GetTypeId(u8& out, const TypeLibrary* p, const char* type) {
|
|
Try(out = p->GetTypeId(ArbUt::StringView(type));)
|
|
}
|
|
export_func u8 CreatureLib_TypeLibrary_RegisterType(u8& out, TypeLibrary* p, const char* type) {
|
|
Try(out = p->RegisterType(ArbUt::StringView(type));)
|
|
}
|
|
|
|
export_func u8 CreatureLib_TypeLibrary_SetEffectiveness(TypeLibrary* p, u8 attacking, u8 defensive,
|
|
float effectiveness) {
|
|
Try(p->SetEffectiveness(attacking, defensive, effectiveness);)
|
|
}
|
|
|
|
export_func u8 CreatureLib_TypeLibrary_GetSingleEffectiveness(float& out, TypeLibrary* p, u8 attacking, u8 defensive) {
|
|
Try(out = p->GetSingleEffectiveness(attacking, defensive);)
|
|
}
|
|
|
|
export_func u8 CreatureLib_TypeLibrary_GetEffectiveness(float& out, TypeLibrary* p, u8 attacking, u8 defensive[],
|
|
size_t defensiveCount) {
|
|
Try(out = p->GetEffectiveness(attacking, ArbUt::List<u8>(defensive, defensive + defensiveCount));)
|
|
}
|
|
export_func u8 CreatureLib_TypeLibrary_GetTypeName(const char*& out, TypeLibrary* p, u8 type) {
|
|
Try(out = p->GetTypeName(type).c_str();)
|
|
}
|