Make the last couple classes use smart pointers.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -4,15 +4,15 @@
|
||||
#include "BaseTurnChoice.hpp"
|
||||
namespace CreatureLib::Battling {
|
||||
class SwitchTurnChoice : public BaseTurnChoice {
|
||||
Creature* _newCreature;
|
||||
ArbUt::BorrowedPtr<Creature> _newCreature;
|
||||
|
||||
public:
|
||||
SwitchTurnChoice(Creature* user, Creature* newCreature) noexcept
|
||||
SwitchTurnChoice(ArbUt::BorrowedPtr<Creature> user, ArbUt::BorrowedPtr<Creature> newCreature) noexcept
|
||||
: BaseTurnChoice(user), _newCreature(newCreature) {}
|
||||
|
||||
TurnChoiceKind GetKind() const noexcept final { return TurnChoiceKind::Switch; }
|
||||
|
||||
inline Creature* GetNewCreature() const noexcept { return _newCreature; }
|
||||
inline const ArbUt::BorrowedPtr<Creature>& GetNewCreature() const noexcept { return _newCreature; }
|
||||
size_t ScriptCount() const override { return GetUser()->ScriptCount(); }
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user