CreatureLib/CInterface/Battling/LearnedAttack.cpp

20 lines
1.2 KiB
C++

#include "../../src/Battling/Models/LearnedAttack.hpp"
#include "../Core.hpp"
using namespace CreatureLib::Battling;
export u8 CreatureLib_LearnedAttack_Construct(LearnedAttack*& out, const CreatureLib::Library::AttackData* attack,
u8 maxUses, AttackLearnMethod learnMethod) {
Try(out = new LearnedAttack(ArbUt::BorrowedPtr<const CreatureLib::Library::AttackData>(attack), maxUses,
learnMethod);)
}
export void CreatureLib_LearnedAttack_Destruct(LearnedAttack* p) { delete p; }
BORROWED_GET_FUNC(LearnedAttack, GetAttack, const CreatureLib::Library::AttackData*);
SIMPLE_GET_FUNC(LearnedAttack, GetMaxUses, u8);
SIMPLE_GET_FUNC(LearnedAttack, GetRemainingUses, u8);
SIMPLE_GET_FUNC(LearnedAttack, GetLearnMethod, AttackLearnMethod);
export bool CreatureLib_LearnedAttack_TryUse(LearnedAttack* p, u8 uses) { return p->TryUse(uses); }
export void CreatureLib_LearnedAttack_DecreaseUses(LearnedAttack* p, u8 uses) { p->DecreaseUses(uses); }
export void CreatureLib_LearnedAttack_RestoreUses(LearnedAttack* p, u8 uses) { p->RestoreUses(uses); }
export void CreatureLib_LearnedAttack_RestoreAllUses(LearnedAttack* p) { p->RestoreAllUses(); }