CreatureLib/CInterface/Library/LearnableAttacks.cpp

32 lines
1.5 KiB
C++
Raw Normal View History

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