feat: use shared_ptr for object state
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include "Domain/Repositories/EntityRepositoryInterface.h"
|
||||
#include "Domain/DTO/EntityState.h"
|
||||
#include "../Factories/DropFactory.h"
|
||||
@@ -15,7 +16,7 @@ namespace Interlude
|
||||
class DropRepository : public Repositories::EntityRepositoryInterface, public FindObjectsTrait
|
||||
{
|
||||
public:
|
||||
const std::vector<DTO::EntityState*> GetEntities() override
|
||||
const std::vector<std::shared_ptr<DTO::EntityState>> GetEntities() override
|
||||
{
|
||||
const std::map<uint32_t, Item*> items = FindAllObjects<Item*>(m_Radius, [this](float_t radius, int32_t prevId) {
|
||||
return m_NetworkHandler.GetNextItem(radius, prevId);
|
||||
@@ -24,7 +25,7 @@ namespace Interlude
|
||||
return m_Factory.Create(item);
|
||||
});
|
||||
|
||||
auto result = std::vector<DTO::EntityState*>();
|
||||
auto result = std::vector<std::shared_ptr<DTO::EntityState>>();
|
||||
|
||||
for (const auto kvp : objects)
|
||||
{
|
||||
|
Reference in New Issue
Block a user