Make ExecutingAttack use smart pointers.

This commit is contained in:
2020-06-02 18:02:37 +02:00
parent a5a613ba5c
commit 7262ae9e8b
5 changed files with 15 additions and 14 deletions

View File

@@ -35,7 +35,7 @@ namespace CreatureLib::Battling {
Library::Gender _gender;
uint8_t _coloring;
ArbUt::BorrowedPtr<const Library::Item> _heldItem;
uint32_t _currentHealth;
uint32_t _currentHealth = -1;
Library::ClampedStatisticSet<int8_t, -6, 6> _statBoost;
Library::StatisticSet<uint32_t> _flatStats;
@@ -99,7 +99,7 @@ namespace CreatureLib::Battling {
inline uint32_t GetCurrentHealth() const noexcept { return _currentHealth; }
void SetBattleData(ArbUt::BorrowedPtr<Battle> battle, BattleSide* side);
void SetBattleData(ArbUt::BorrowedPtr<Battle> battle, ArbUt::BorrowedPtr<BattleSide> side);
const ArbUt::BorrowedPtr<Battle>& GetBattle() const;
const ArbUt::BorrowedPtr<BattleSide>& GetBattleSide() const;
void SetOnBattleField(bool value) { _onBattleField = value; }
@@ -139,7 +139,9 @@ namespace CreatureLib::Battling {
void SetDisplaySpecies(const ArbUt::BorrowedPtr<const Library::CreatureSpecies>& species) noexcept {
_displaySpecies = species;
}
void SetDisplayVariant(const Library::SpeciesVariant* variant) noexcept { _displayVariant = variant; };
void SetDisplayVariant(ArbUt::BorrowedPtr<const Library::SpeciesVariant> variant) noexcept {
_displayVariant = variant;
};
inline bool AllowedExperienceGain() const noexcept { return _allowedExperienceGain; }
inline void SetAllowedExperienceGain(bool allowed) noexcept { _allowedExperienceGain = allowed; }