From a5a613ba5c7f304fe75729e906d6081333170e1d Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Tue, 2 Jun 2020 17:19:23 +0200 Subject: [PATCH] Make CreateCreature use smart pointers. --- src/Battling/Models/CreateCreature.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Battling/Models/CreateCreature.hpp b/src/Battling/Models/CreateCreature.hpp index 65a4a7a..5c24191 100644 --- a/src/Battling/Models/CreateCreature.hpp +++ b/src/Battling/Models/CreateCreature.hpp @@ -8,7 +8,7 @@ namespace CreatureLib::Battling { class CreateCreature { - const BattleLibrary* _library; + ArbUt::BorrowedPtr _library; ArbUt::CaseInsensitiveConstString _species; ArbUt::CaseInsensitiveConstString _variant = "default"_cnc; uint8_t _level; @@ -22,7 +22,8 @@ namespace CreatureLib::Battling { ArbUt::List, AttackLearnMethod>> _attacks; public: - CreateCreature(const BattleLibrary* library, const ArbUt::CaseInsensitiveConstString& species, uint8_t level) + CreateCreature(ArbUt::BorrowedPtr library, + const ArbUt::CaseInsensitiveConstString& species, uint8_t level) : _library(library), _species(species), _level(level), _attacks(library->GetSettings()->GetMaximalMoves()) { }