SUpport for EggMoves
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
badfccf440
commit
9274b675e9
|
@ -29,5 +29,7 @@ public:
|
||||||
export returnType PkmnLib_##type##_##name(const type* p) { return p->name(); }
|
export returnType PkmnLib_##type##_##name(const type* p) { return p->name(); }
|
||||||
#define SIMPLE_GET_FUNC_SMART_PTR(type, name, returnType) \
|
#define SIMPLE_GET_FUNC_SMART_PTR(type, name, returnType) \
|
||||||
export returnType PkmnLib_##type##_##name(const type* p) { return p->name().GetRaw(); }
|
export returnType PkmnLib_##type##_##name(const type* p) { return p->name().GetRaw(); }
|
||||||
|
#define DESTRUCTOR(type) \
|
||||||
|
export void PkmnLib_##type##_Destruct(const type* p) { delete p; }
|
||||||
|
|
||||||
#endif // PKMNLIB_CORE_HPP
|
#endif // PKMNLIB_CORE_HPP
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
#include "../../src/Library/Species/LearnableMoves.hpp"
|
||||||
|
#include "../Core.hpp"
|
||||||
|
using namespace PkmnLib::Library;
|
||||||
|
|
||||||
|
export uint8_t PkmnLib_LearnableMoves_Construct(LearnableMoves*& out, size_t levelAttackCapacity) {
|
||||||
|
Try(out = new LearnableMoves(levelAttackCapacity));
|
||||||
|
}
|
||||||
|
DESTRUCTOR(LearnableMoves)
|
||||||
|
|
||||||
|
export void PkmnLib_LearnableMoves_AddEggMove(LearnableMoves* p, MoveData* move) { p->AddEggMove(move); }
|
||||||
|
export size_t PkmnLib_LearnableMoves_GetEggMovesCount(LearnableMoves* p) { return p->GetEggMoves().Count(); }
|
||||||
|
export const MoveData* const* PkmnLib_LearnableMoves_GetEggMoves(LearnableMoves* p) {
|
||||||
|
return reinterpret_cast<const MoveData* const*>(p->GetEggMoves().RawData());
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
#include "LearnableMoves.hpp"
|
|
@ -0,0 +1,25 @@
|
||||||
|
#ifndef PKMNLIB_LEARNABLEMOVES_HPP
|
||||||
|
#define PKMNLIB_LEARNABLEMOVES_HPP
|
||||||
|
|
||||||
|
#include <Arbutils/Collections/List.hpp>
|
||||||
|
#include <Arbutils/Memory/BorrowedPtr.hpp>
|
||||||
|
#include <CreatureLib/Library/CreatureData/LearnableAttacks.hpp>
|
||||||
|
#include "../Moves/MoveData.hpp"
|
||||||
|
|
||||||
|
namespace PkmnLib::Library {
|
||||||
|
class LearnableMoves : CreatureLib::Library::LearnableAttacks {
|
||||||
|
ArbUt::List<ArbUt::BorrowedPtr<const MoveData>> _eggMoves;
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit LearnableMoves(size_t levelAttackCapacity) : LearnableAttacks(levelAttackCapacity) {}
|
||||||
|
|
||||||
|
void AddEggMove(const ArbUt::BorrowedPtr<const MoveData>& move) noexcept {
|
||||||
|
if (!_eggMoves.Contains(move))
|
||||||
|
_eggMoves.Append(move);
|
||||||
|
}
|
||||||
|
|
||||||
|
const ArbUt::List<ArbUt::BorrowedPtr<const MoveData>>& GetEggMoves() const noexcept { return _eggMoves; }
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // PKMNLIB_LEARNABLEMOVES_HPP
|
Loading…
Reference in New Issue