From e6f84f182a9d76713c9216cda0197f9f1cc00a7b Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sat, 25 Jul 2020 15:02:11 +0200 Subject: [PATCH] Add Creature getter for the library. --- CInterface/Battling/Creature.cpp | 1 + src/Battling/Models/Creature.hpp | 1 + 2 files changed, 2 insertions(+) diff --git a/CInterface/Battling/Creature.cpp b/CInterface/Battling/Creature.cpp index 3622d62..265c901 100644 --- a/CInterface/Battling/Creature.cpp +++ b/CInterface/Battling/Creature.cpp @@ -18,6 +18,7 @@ export uint8_t CreatureLib_Creature_Construct(Creature*& out, const BattleLibrar export void CreatureLib_Creature_Destruct(const Creature* p) { delete p; } +BORROWED_GET_FUNC(Creature, GetLibrary, const CreatureLib::Battling::BattleLibrary*); BORROWED_GET_FUNC(Creature, GetSpecies, const CreatureLib::Library::CreatureSpecies*); BORROWED_GET_FUNC(Creature, GetVariant, const CreatureLib::Library::SpeciesVariant*); diff --git a/src/Battling/Models/Creature.hpp b/src/Battling/Models/Creature.hpp index 2e24cdf..f6933c3 100644 --- a/src/Battling/Models/Creature.hpp +++ b/src/Battling/Models/Creature.hpp @@ -80,6 +80,7 @@ namespace CreatureLib::Battling { _currentHealth = GetBoostedStat(Library::Statistic::Health); } + inline const ArbUt::BorrowedPtr& GetLibrary() const noexcept { return _library; } inline const ArbUt::BorrowedPtr& GetSpecies() const noexcept { return _species; }