C Interface to get targets array from ExecutingAttack.

Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
Deukhoofd 2020-08-14 17:59:56 +02:00
parent 73f48eab7a
commit 46ab060b99
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
2 changed files with 5 additions and 0 deletions

View File

@ -20,6 +20,10 @@ export uint8_t CreatureLib_ExecutingAttack_GetHitData(ExecutingAttack::HitData*&
export bool CreatureLib_ExecutingAttack_IsCreatureTarget(ExecutingAttack* p, Creature* target) { export bool CreatureLib_ExecutingAttack_IsCreatureTarget(ExecutingAttack* p, Creature* target) {
return p->IsCreatureTarget(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<const Creature* const*>(p->GetTargets());
}
export Creature* CreatureLib_ExecutingAttack_GetUser(ExecutingAttack* p) { return p->GetUser().GetRaw(); } export Creature* CreatureLib_ExecutingAttack_GetUser(ExecutingAttack* p) { return p->GetUser().GetRaw(); }
export LearnedAttack* CreatureLib_ExecutingAttack_GetAttack(ExecutingAttack* p) { return p->GetAttack().GetRaw(); } export LearnedAttack* CreatureLib_ExecutingAttack_GetAttack(ExecutingAttack* p) { return p->GetAttack().GetRaw(); }

View File

@ -88,6 +88,7 @@ namespace CreatureLib::Battling {
} }
inline uint8_t GetTargetCount() const noexcept { return _targetCount; } inline uint8_t GetTargetCount() const noexcept { return _targetCount; }
inline const ArbUt::BorrowedPtr<Creature>* GetTargets() const noexcept { return _targets; } inline const ArbUt::BorrowedPtr<Creature>* GetTargets() const noexcept { return _targets; }
inline uint8_t GetNumberOfHits() const noexcept { return _numberHits; } inline uint8_t GetNumberOfHits() const noexcept { return _numberHits; }