CreatureLib/CInterface/Library/GrowthRateLibrary.cpp

38 lines
2.0 KiB
C++
Raw Normal View History

#include "../../src/Library/GrowthRates/GrowthRateLibrary.hpp"
#include "../Core.hpp"
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 u8 CreatureLib_GrowthRateLibrary_CalculateLevel(level_int_t& out, GrowthRateLibrary* library,
const char* growthRate, u32 experience) {
2020-06-26 15:08:23 +00:00
Try(out = library->CalculateLevel(ArbUt::StringView::CalculateHash(growthRate), experience);)
}
export u8 CreatureLib_GrowthRateLibrary_CalculateLevelWithHash(level_int_t& out, GrowthRateLibrary* library,
u32 growthRateHash, u32 experience) {
Try(out = library->CalculateLevel(growthRateHash, experience);)
}
export u8 CreatureLib_GrowthRateLibrary_CalculateExperience(u32& out, GrowthRateLibrary* library,
const char* growthRate, level_int_t level) {
2020-06-26 15:08:23 +00:00
Try(out = library->CalculateExperience(ArbUt::StringView::CalculateHash(growthRate), level);)
}
export u8 CreatureLib_GrowthRateLibrary_CalculateExperienceWithHash(u32& out, GrowthRateLibrary* library,
u32 growthRateHash, level_int_t level) {
Try(out = library->CalculateExperience(growthRateHash, level);)
}
export u8 CreatureLib_GrowthRateLibrary_AddGrowthRate(GrowthRateLibrary* library, const char* growthRateName,
GrowthRate* growthRate) {
2020-06-26 15:08:23 +00:00
Try(library->AddGrowthRate(ArbUt::StringView::CalculateHash(growthRateName), growthRate);)
}
export u8 CreatureLib_GrowthRateLibrary_AddGrowthRateWithHash(GrowthRateLibrary* library, u32 growthRateHash,
GrowthRate* growthRate) {
Try(library->AddGrowthRate(growthRateHash, growthRate);)
}