Use smart pointer for BattleParty.
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
18203138d1
commit
49e8ff055d
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue