From 46ab060b99c264eab8a54a2306e96672a3cab9df Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Fri, 14 Aug 2020 17:59:56 +0200 Subject: [PATCH] C Interface to get targets array from ExecutingAttack. Signed-off-by: Deukhoofd --- CInterface/Battling/ExecutingAttack.cpp | 4 ++++ src/Battling/Models/ExecutingAttack.hpp | 1 + 2 files changed, 5 insertions(+) diff --git a/CInterface/Battling/ExecutingAttack.cpp b/CInterface/Battling/ExecutingAttack.cpp index c515a58..ca25d1d 100644 --- a/CInterface/Battling/ExecutingAttack.cpp +++ b/CInterface/Battling/ExecutingAttack.cpp @@ -20,6 +20,10 @@ export uint8_t CreatureLib_ExecutingAttack_GetHitData(ExecutingAttack::HitData*& export bool CreatureLib_ExecutingAttack_IsCreatureTarget(ExecutingAttack* p, Creature* target) { return p->IsCreatureTarget(target); } +export uint8_t CreatureLib_ExecutingAttack_GetTargetCount(ExecutingAttack* p) { return p->GetTargetCount(); } +export const Creature* const* CreatureLib_ExecutingAttack_GetTargets(ExecutingAttack* p) { + return reinterpret_cast(p->GetTargets()); +} export Creature* CreatureLib_ExecutingAttack_GetUser(ExecutingAttack* p) { return p->GetUser().GetRaw(); } export LearnedAttack* CreatureLib_ExecutingAttack_GetAttack(ExecutingAttack* p) { return p->GetAttack().GetRaw(); } diff --git a/src/Battling/Models/ExecutingAttack.hpp b/src/Battling/Models/ExecutingAttack.hpp index 07f97c0..1fee080 100644 --- a/src/Battling/Models/ExecutingAttack.hpp +++ b/src/Battling/Models/ExecutingAttack.hpp @@ -88,6 +88,7 @@ namespace CreatureLib::Battling { } inline uint8_t GetTargetCount() const noexcept { return _targetCount; } + inline const ArbUt::BorrowedPtr* GetTargets() const noexcept { return _targets; } inline uint8_t GetNumberOfHits() const noexcept { return _numberHits; }