1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-13 01:20:34 +02:00

Map objects now use shared_ptr (rmg)

This commit is contained in:
Ivan Savenko
2025-03-13 20:13:27 +00:00
parent dda5c9f13a
commit 84cf7b052d
19 changed files with 145 additions and 145 deletions

View File

@ -32,9 +32,9 @@ struct DistanceMaximizeFunctor
struct RequiredObjectInfo
{
RequiredObjectInfo();
RequiredObjectInfo(CGObjectInstance* obj, ui32 guardStrength = 0, bool createRoad = false, CGObjectInstance* nearbyTarget = nullptr);
RequiredObjectInfo(std::shared_ptr<CGObjectInstance> obj, ui32 guardStrength = 0, bool createRoad = false, CGObjectInstance* nearbyTarget = nullptr);
CGObjectInstance* obj;
std::shared_ptr<CGObjectInstance> obj;
CGObjectInstance* nearbyTarget;
int3 pos;
ui32 guardStrength;
@ -71,7 +71,7 @@ public:
rmg::Path placeAndConnectObject(const rmg::Area & searchArea, rmg::Object & obj, si32 min_dist, bool isGuarded, bool onlyStraight, OptimizeType optimizer) const;
rmg::Path placeAndConnectObject(const rmg::Area & searchArea, rmg::Object & obj, const std::function<float(const int3)> & weightFunction, bool isGuarded, bool onlyStraight, OptimizeType optimizer) const;
CGCreature * chooseGuard(si32 strength, bool zoneGuard = false);
std::shared_ptr<CGCreature> chooseGuard(si32 strength, bool zoneGuard = false);
bool addGuard(rmg::Object & object, si32 strength, bool zoneGuard = false);
void placeObject(rmg::Object & object, bool guarded, bool updateDistance, bool createRoad = false);