Reworked LearnedAttacks class, added C interface.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
20
CInterface/Library/LearnableAttacks.cpp
Normal file
20
CInterface/Library/LearnableAttacks.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#include "../../src/Library/CreatureData/LearnableAttacks.hpp"
|
||||
#define export extern "C"
|
||||
using namespace CreatureLib::Library;
|
||||
|
||||
export LearnableAttacks* CreatureLib_LearnableAttacks_Construct(size_t levelAttackCapacity) {
|
||||
return new LearnableAttacks(levelAttackCapacity);
|
||||
};
|
||||
|
||||
export void CreatureLib_LearnableAttacks_Destruct(LearnableAttacks* p) { delete p; }
|
||||
|
||||
export void CreatureLib_LearnableAttacks_AddLevelMove(LearnableAttacks* p, uint8_t level, const AttackData* attack) {
|
||||
p->AddLevelMove(level, attack);
|
||||
}
|
||||
|
||||
export const AttackData* const* CreatureLib_LearnableAttacks_GetAttacksForLevel(LearnableAttacks* p, uint8_t level) {
|
||||
return p->GetAttacksForLevel(level).data();
|
||||
}
|
||||
export size_t CreatureLib_LearnableAttacks_GetAttacksForLevelCount(LearnableAttacks* p, uint8_t level) {
|
||||
return p->GetAttacksForLevel(level).size();
|
||||
}
|
||||
Reference in New Issue
Block a user