DJWarmonger 7 lat temu
rodzic
commit
30f99e7cc1

+ 1 - 1
AI/VCAI/ResourceManager.cpp

@@ -77,7 +77,7 @@ TResources ResourceManager::estimateIncome() const
 	return ret;
 }
 
-void ResourceManager::reserveResoures(TResources & res, Goals::TSubgoal goal)
+void ResourceManager::reserveResoures(const TResources & res, Goals::TSubgoal goal)
 {
 	if (!goal->invalid())
 		tryPush(ResourceObjective(res, goal));

+ 1 - 1
AI/VCAI/ResourceManager.h

@@ -85,7 +85,7 @@ public:
 	bool hasTasksLeft() const override;
 
 protected: //not-const actions only for AI
-	virtual void reserveResoures(TResources & res, Goals::TSubgoal goal = Goals::TSubgoal());
+	virtual void reserveResoures(const TResources & res, Goals::TSubgoal goal = Goals::TSubgoal());
 	virtual bool notifyGoalCompleted(Goals::TSubgoal goal);
 	virtual bool updateGoal(Goals::TSubgoal goal); //new goal must have same properties but different priority
 	virtual bool tryPush(const ResourceObjective &o);

+ 1 - 1
test/vcai/mock_ResourceManager.cpp

@@ -2,7 +2,7 @@
 
 #include "mock_ResourceManager.h"
 
-void ResourceManagerMock::reserveResoures(TResources &res, Goals::TSubgoal goal)
+void ResourceManagerMock::reserveResoures(const TResources &res, Goals::TSubgoal goal)
 {
 	ResourceManager::reserveResoures(res, goal);
 }

+ 1 - 1
test/vcai/mock_ResourceManager.h

@@ -13,7 +13,7 @@ class ResourceManagerMock : public ResourceManager
 public:
 	using ResourceManager::ResourceManager;
 	//access protected members, TODO: consider other architecture?
-	void reserveResoures(TResources &res, Goals::TSubgoal goal = Goals::TSubgoal()) override;
+	void reserveResoures(const TResources &res, Goals::TSubgoal goal = Goals::TSubgoal()) override;
 	bool updateGoal(Goals::TSubgoal goal) override;
 	bool notifyGoalCompleted(Goals::TSubgoal goal) override;
 };