CreatureLib/CInterface/Library/GrowthRateLibrary.cpp

38 lines
2.1 KiB
C++

#include "../../src/Library/GrowthRates/GrowthRateLibrary.hpp"
#define export extern "C"
using namespace CreatureLib::Library;
export GrowthRateLibrary* CreatureLib_GrowthRateLibrary_Construct(size_t initialCapacity) {
return new GrowthRateLibrary(initialCapacity);
}
export void CreatureLib_GrowthRateLibrary_Destruct(GrowthRateLibrary* p) { delete p; }
export uint8_t CreatureLib_GrowthRateLibrary_CalculateLevel(GrowthRateLibrary* library, const char* growthRate,
uint32_t experience) {
return library->CalculateLevel(Arbutils::CaseInsensitiveConstString::GetHash(growthRate), experience);
}
export uint8_t CreatureLib_GrowthRateLibrary_CalculateLevelWithHash(GrowthRateLibrary* library, uint32_t growthRateHash,
uint32_t experience) {
return library->CalculateLevel(growthRateHash, experience);
}
export uint32_t CreatureLib_GrowthRateLibrary_CalculateExperience(GrowthRateLibrary* library, const char* growthRate,
uint8_t level) {
return library->CalculateExperience(Arbutils::CaseInsensitiveConstString::GetHash(growthRate), level);
}
export uint32_t CreatureLib_GrowthRateLibrary_CalculateExperienceWithHash(GrowthRateLibrary* library,
uint32_t growthRateHash, uint8_t level) {
return library->CalculateExperience(growthRateHash, level);
}
export void CreatureLib_GrowthRateLibrary_AddGrowthRate(GrowthRateLibrary* library, const char* growthRateName,
GrowthRate* growthRate) {
return library->AddGrowthRate(Arbutils::CaseInsensitiveConstString::GetHash(growthRateName), growthRate);
}
export void CreatureLib_GrowthRateLibrary_AddGrowthRateWithHash(GrowthRateLibrary* library, uint32_t growthRateHash,
GrowthRate* growthRate) {
return library->AddGrowthRate(growthRateHash, growthRate);
}