refactor: replace unique_ptr to shared_ptr

This commit is contained in:
k0t9i
2023-02-10 18:49:47 +04:00
parent bb4538794b
commit 81e26a7e52
13 changed files with 51 additions and 67 deletions

View File

@@ -10,7 +10,7 @@ namespace L2Bot::Domain::DTO
class EntityState
{
public:
const std::unique_ptr<Entities::EntityInterface>& GetEntity() const
const std::shared_ptr<Entities::EntityInterface>& GetEntity() const
{
return m_Entity;
}
@@ -23,8 +23,8 @@ namespace L2Bot::Domain::DTO
m_State = state;
}
EntityState(std::unique_ptr<Entities::EntityInterface> object, Enums::EntityStateEnum state) :
m_Entity(std::move(object)),
EntityState(std::shared_ptr<Entities::EntityInterface> object, Enums::EntityStateEnum state) :
m_Entity(object),
m_State(state)
{
@@ -33,7 +33,7 @@ namespace L2Bot::Domain::DTO
EntityState() = default;
virtual ~EntityState() = default;
private:
std::unique_ptr<Entities::EntityInterface> m_Entity = nullptr;
std::shared_ptr<Entities::EntityInterface> m_Entity = nullptr;
Enums::EntityStateEnum m_State = Enums::EntityStateEnum::none;
};
}

View File

@@ -98,7 +98,8 @@ namespace L2Bot::Domain::Entities
EtcItem(const EtcItem* other) :
BaseItem(other),
m_Amount(other->m_Amount),
m_IsAutoused(other->m_IsAutoused)
m_IsAutoused(other->m_IsAutoused),
m_IsQuest(other->m_IsQuest)
{
}