Use smart pointers for BattleSide.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2020-06-02 13:06:24 +02:00
parent 49e8ff055d
commit f898698f49
20 changed files with 86 additions and 107 deletions

View File

@@ -41,7 +41,7 @@ namespace CreatureLib::Battling {
Library::StatisticSet<uint32_t> _flatStats;
Library::StatisticSet<uint32_t> _boostedStats;
Battle* _battle = nullptr;
ArbUt::BorrowedPtr<Battle> _battle = nullptr;
BattleSide* _side = nullptr;
bool _onBattleField = false;
@@ -101,8 +101,8 @@ namespace CreatureLib::Battling {
inline uint32_t GetCurrentHealth() const noexcept { return _currentHealth; }
void SetBattleData(Battle* battle, BattleSide* side);
Battle* GetBattle() const;
void SetBattleData(ArbUt::BorrowedPtr<Battle> battle, BattleSide* side);
const ArbUt::BorrowedPtr<Battle>& GetBattle() const;
BattleSide* GetBattleSide() const;
void SetOnBattleField(bool value) { _onBattleField = value; }
bool IsOnBattleField() const { return _onBattleField; }