CreatureLib/CInterface/Library/GrowthRateLibrary.cpp

38 lines
2.1 KiB
C++
Raw Permalink Normal View History

#include "../../src/Library/GrowthRates/GrowthRateLibrary.hpp"
#include "../Core.hpp"
using namespace CreatureLib::Library;
2022-04-02 10:33:26 +00:00
export_func GrowthRateLibrary* CreatureLib_GrowthRateLibrary_Construct(size_t initialCapacity) {
return new GrowthRateLibrary(initialCapacity);
}
2022-04-02 10:33:26 +00:00
export_func void CreatureLib_GrowthRateLibrary_Destruct(GrowthRateLibrary* p) { delete p; }
2022-04-02 10:33:26 +00:00
export_func 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);)
}
2022-04-02 10:33:26 +00:00
export_func u8 CreatureLib_GrowthRateLibrary_CalculateLevelWithHash(level_int_t& out, GrowthRateLibrary* library,
u32 growthRateHash, u32 experience) {
Try(out = library->CalculateLevel(growthRateHash, experience);)
}
2022-04-02 10:33:26 +00:00
export_func 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);)
}
2022-04-02 10:33:26 +00:00
export_func u8 CreatureLib_GrowthRateLibrary_CalculateExperienceWithHash(u32& out, GrowthRateLibrary* library,
u32 growthRateHash, level_int_t level) {
Try(out = library->CalculateExperience(growthRateHash, level);)
}
2022-04-02 10:33:26 +00:00
export_func 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);)
}
2022-04-02 10:33:26 +00:00
export_func u8 CreatureLib_GrowthRateLibrary_AddGrowthRateWithHash(GrowthRateLibrary* library, u32 growthRateHash,
GrowthRate* growthRate) {
Try(library->AddGrowthRate(growthRateHash, growthRate);)
}