2020-02-29 15:06:47 +00:00
|
|
|
#include "../../src/Library/GrowthRates/GrowthRateLibrary.hpp"
|
2020-07-31 08:51:03 +00:00
|
|
|
#include "../Core.hpp"
|
2020-02-29 16:21:36 +00:00
|
|
|
using namespace CreatureLib::Library;
|
2020-02-29 15:06:47 +00:00
|
|
|
|
2020-02-29 16:21:36 +00:00
|
|
|
export GrowthRateLibrary* CreatureLib_GrowthRateLibrary_Construct(size_t initialCapacity) {
|
|
|
|
return new GrowthRateLibrary(initialCapacity);
|
2020-02-29 15:06:47 +00:00
|
|
|
}
|
|
|
|
|
2020-02-29 16:21:36 +00:00
|
|
|
export void CreatureLib_GrowthRateLibrary_Destruct(GrowthRateLibrary* p) { delete p; }
|
2020-02-29 15:06:47 +00:00
|
|
|
|
2020-08-19 18:11:00 +00:00
|
|
|
export uint8_t CreatureLib_GrowthRateLibrary_CalculateLevel(level_int_t& out, GrowthRateLibrary* library,
|
2020-03-25 18:07:36 +00:00
|
|
|
const char* growthRate, uint32_t experience) {
|
2020-06-26 15:08:23 +00:00
|
|
|
Try(out = library->CalculateLevel(ArbUt::StringView::CalculateHash(growthRate), experience);)
|
2020-02-29 15:06:47 +00:00
|
|
|
}
|
2020-08-19 18:11:00 +00:00
|
|
|
export uint8_t CreatureLib_GrowthRateLibrary_CalculateLevelWithHash(level_int_t& out, GrowthRateLibrary* library,
|
2020-03-25 18:07:36 +00:00
|
|
|
uint32_t growthRateHash, uint32_t experience) {
|
|
|
|
Try(out = library->CalculateLevel(growthRateHash, experience);)
|
2020-02-29 15:06:47 +00:00
|
|
|
}
|
|
|
|
|
2020-03-25 18:07:36 +00:00
|
|
|
export uint8_t CreatureLib_GrowthRateLibrary_CalculateExperience(uint32_t& out, GrowthRateLibrary* library,
|
2020-08-19 18:11:00 +00:00
|
|
|
const char* growthRate, level_int_t level) {
|
2020-06-26 15:08:23 +00:00
|
|
|
Try(out = library->CalculateExperience(ArbUt::StringView::CalculateHash(growthRate), level);)
|
2020-02-29 15:06:47 +00:00
|
|
|
}
|
|
|
|
|
2020-03-25 18:07:36 +00:00
|
|
|
export uint8_t CreatureLib_GrowthRateLibrary_CalculateExperienceWithHash(uint32_t& out, GrowthRateLibrary* library,
|
2020-08-19 18:11:00 +00:00
|
|
|
uint32_t growthRateHash, level_int_t level) {
|
2020-03-25 18:07:36 +00:00
|
|
|
Try(out = library->CalculateExperience(growthRateHash, level);)
|
2020-02-29 15:06:47 +00:00
|
|
|
}
|
2020-03-25 18:07:36 +00:00
|
|
|
export uint8_t 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);)
|
2020-02-29 15:06:47 +00:00
|
|
|
}
|
|
|
|
|
2020-03-25 18:07:36 +00:00
|
|
|
export uint8_t CreatureLib_GrowthRateLibrary_AddGrowthRateWithHash(GrowthRateLibrary* library, uint32_t growthRateHash,
|
|
|
|
GrowthRate* growthRate) {
|
|
|
|
Try(library->AddGrowthRate(growthRateHash, growthRate);)
|
2020-02-29 15:06:47 +00:00
|
|
|
}
|