CreatureLib/CInterface/Library/LearnableAttacks.cpp

31 lines
1.4 KiB
C++
Raw Normal View History

#include "../../src/Library/CreatureData/LearnableAttacks.hpp"
#include "../Core.hpp"
using namespace CreatureLib::Library;
export uint8_t CreatureLib_LearnableAttacks_Construct(LearnableAttacks*& out, size_t levelAttackCapacity) {
Try(out = new LearnableAttacks(levelAttackCapacity);)
};
export void CreatureLib_LearnableAttacks_Destruct(LearnableAttacks* p) { delete p; }
2020-04-19 17:15:50 +00:00
export void CreatureLib_LearnableAttacks_AddLevelAttack(LearnableAttacks* p, uint8_t level, const AttackData* attack) {
p->AddLevelAttack(level, attack);
}
export const AttackData* const* CreatureLib_LearnableAttacks_GetAttacksForLevel(LearnableAttacks* p, uint8_t level) {
return reinterpret_cast<const AttackData* const*>(p->GetAttacksForLevel(level).RawData());
}
export bool CreatureLib_LearnableAttacks_HasAttacksForLevel(LearnableAttacks* p, uint8_t level) {
return p->HasAttacksForLevel(level);
}
export size_t CreatureLib_LearnableAttacks_GetAttacksForLevelCount(LearnableAttacks* p, uint8_t level) {
return p->GetAttacksForLevel(level).Count();
}
export size_t CreatureLib_LearnableAttacks_GetDistinctLevelAttacksCount(LearnableAttacks* p) {
return p->GetDistinctLevelAttacks().Count();
}
export const AttackData* const* CreatureLib_LearnableAttacks_GetDistinctLevelAttacks(LearnableAttacks* p) {
return reinterpret_cast<const AttackData* const*>(p->GetDistinctLevelAttacks().RawData());
}