Make CreateCreature use smart pointers.
This commit is contained in:
parent
62583ecb17
commit
a5a613ba5c
|
@ -8,7 +8,7 @@
|
|||
|
||||
namespace CreatureLib::Battling {
|
||||
class CreateCreature {
|
||||
const BattleLibrary* _library;
|
||||
ArbUt::BorrowedPtr<const BattleLibrary> _library;
|
||||
ArbUt::CaseInsensitiveConstString _species;
|
||||
ArbUt::CaseInsensitiveConstString _variant = "default"_cnc;
|
||||
uint8_t _level;
|
||||
|
@ -22,7 +22,8 @@ namespace CreatureLib::Battling {
|
|||
ArbUt::List<std::tuple<ArbUt::BorrowedPtr<const Library::AttackData>, AttackLearnMethod>> _attacks;
|
||||
|
||||
public:
|
||||
CreateCreature(const BattleLibrary* library, const ArbUt::CaseInsensitiveConstString& species, uint8_t level)
|
||||
CreateCreature(ArbUt::BorrowedPtr<const BattleLibrary> library,
|
||||
const ArbUt::CaseInsensitiveConstString& species, uint8_t level)
|
||||
: _library(library), _species(species), _level(level), _attacks(library->GetSettings()->GetMaximalMoves()) {
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue