Use smart pointer for BattleParty.
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Deukhoofd 2020-06-02 12:16:26 +02:00
parent 18203138d1
commit 49e8ff055d
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
1 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@
namespace CreatureLib::Battling {
class BattleParty {
CreatureParty* _party;
ArbUt::BorrowedPtr<CreatureParty> _party;
ArbUt::List<CreatureIndex> _responsibleIndices;
public:
@ -17,7 +17,7 @@ namespace CreatureLib::Battling {
AssertNotNull(_party)
}
inline CreatureParty* GetParty() const { return _party; }
inline const ArbUt::BorrowedPtr<CreatureParty>& GetParty() const { return _party; }
inline const ArbUt::List<CreatureIndex>& GetResponsibleIndices() const { return _responsibleIndices; }
inline bool IsResponsibleForIndex(const CreatureIndex& index) const {
@ -27,7 +27,7 @@ namespace CreatureLib::Battling {
bool IsResponsibleForIndex(uint8_t side, uint8_t index) const;
inline bool HasCreaturesNotInField() const {
auto& p = _party->GetParty();
const auto& p = _party->GetParty();
for (const auto& creature : p) {
if (creature == nullptr)
continue;