Adds getter for parties to battle.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-05-24 12:57:12 +02:00
parent 2e860192c7
commit c056ddc6b3
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
2 changed files with 5 additions and 1 deletions

View File

@ -48,6 +48,9 @@ export bool CreatureLib_Battle_GetWinningSide(const Battle* p) { return p->GetRe
export size_t CreatureLib_Battle_GetSidesCount(const Battle* p) { return p->GetSides().Count(); }
export BattleSide* const* CreatureLib_Battle_GetSides(const Battle* p) { return p->GetSides().RawData(); }
export size_t CreatureLib_Battle_GetPartiesCount(const Battle* p) { return p->GetParties().Count(); }
export BattleParty* const* CreatureLib_Battle_GetParties(const Battle* p) { return p->GetParties().RawData(); }
export Script* CreatureLib_Battle_GetVolatileScript(Battle* p, const char* key) {
return p->GetVolatileScript(ConstString::GetHash(key));
}
@ -71,4 +74,4 @@ export uint8_t CreatureLib_Battle_RegisterEventListener(Battle* p, void (*func)(
}
export uint8_t CreatureLib_Battle_TriggerEventListener(Battle* p, EventData* data) {
Try(p->TriggerEventListener(data);)
}
}

View File

@ -88,6 +88,7 @@ namespace CreatureLib::Battling {
inline bool HasEnded() const noexcept { return _hasEnded; }
inline const BattleResult& GetResult() const noexcept { return _battleResult; }
const List<BattleParty*>& GetParties() const noexcept { return _parties; }
const List<BattleSide*>& GetSides() const noexcept { return _sides; }
Script* GetVolatileScript(const ConstString& key) const { return _volatile.Get(key); }
Script* GetVolatileScript(uint32_t keyHash) const noexcept { return _volatile.Get(keyHash); }