1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Map objects now use shared_ptr (game)

This commit is contained in:
Ivan Savenko
2025-03-13 19:42:18 +00:00
parent 2ca1748e96
commit 0ada2a5ebd
49 changed files with 487 additions and 613 deletions

View File

@@ -124,7 +124,7 @@ public:
class CInsertObjectOperation : public CMapOperation
{
public:
CInsertObjectOperation(CMap * map, CGObjectInstance * obj);
CInsertObjectOperation(CMap * map, std::shared_ptr<CGObjectInstance> obj);
void execute() override;
void undo() override;
@@ -132,7 +132,7 @@ public:
std::string getLabel() const override;
private:
CGObjectInstance * obj;
std::shared_ptr<CGObjectInstance> obj;
};
/// The CMoveObjectOperation class moves object to another position
@@ -157,7 +157,6 @@ class CRemoveObjectOperation : public CMapOperation
{
public:
CRemoveObjectOperation(CMap* map, CGObjectInstance * obj);
~CRemoveObjectOperation();
void execute() override;
void undo() override;
@@ -165,7 +164,8 @@ public:
std::string getLabel() const override;
private:
CGObjectInstance* obj;
CGObjectInstance * targetedObject;
std::shared_ptr<CGObjectInstance> removedObject;
};
VCMI_LIB_NAMESPACE_END