mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-26 03:52:01 +02:00
Fixed non-const reference issue.
This commit is contained in:
parent
ea19716fb9
commit
6abebeeb9f
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#define GOLD_RESERVE (10000); //at least we'll be able to reach capitol
|
#define GOLD_RESERVE (10000); //at least we'll be able to reach capitol
|
||||||
|
|
||||||
ResourceObjective::ResourceObjective(TResources & Res, Goals::TSubgoal Goal)
|
ResourceObjective::ResourceObjective(const TResources & Res, Goals::TSubgoal Goal)
|
||||||
: resources(Res), goal(Goal)
|
: resources(Res), goal(Goal)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -248,7 +248,7 @@ bool ResourceManager::updateGoal(Goals::TSubgoal goal)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ResourceManager::tryPush(ResourceObjective & o)
|
bool ResourceManager::tryPush(const ResourceObjective & o)
|
||||||
{
|
{
|
||||||
auto goal = o.goal;
|
auto goal = o.goal;
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ class IResourceManager;
|
|||||||
struct DLL_EXPORT ResourceObjective
|
struct DLL_EXPORT ResourceObjective
|
||||||
{
|
{
|
||||||
ResourceObjective() = default;
|
ResourceObjective() = default;
|
||||||
ResourceObjective(TResources &res, Goals::TSubgoal goal);
|
ResourceObjective(const TResources &res, Goals::TSubgoal goal);
|
||||||
bool operator < (const ResourceObjective &ro) const;
|
bool operator < (const ResourceObjective &ro) const;
|
||||||
|
|
||||||
TResources resources; //how many resoures do we need
|
TResources resources; //how many resoures do we need
|
||||||
@ -88,7 +88,7 @@ protected: //not-const actions only for AI
|
|||||||
virtual void reserveResoures(TResources &res, Goals::TSubgoal goal = Goals::TSubgoal());
|
virtual void reserveResoures(TResources &res, Goals::TSubgoal goal = Goals::TSubgoal());
|
||||||
virtual bool notifyGoalCompleted(Goals::TSubgoal goal);
|
virtual bool notifyGoalCompleted(Goals::TSubgoal goal);
|
||||||
virtual bool updateGoal(Goals::TSubgoal goal); //new goal must have same properties but different priority
|
virtual bool updateGoal(Goals::TSubgoal goal); //new goal must have same properties but different priority
|
||||||
virtual bool tryPush(ResourceObjective &o);
|
virtual bool tryPush(const ResourceObjective &o);
|
||||||
|
|
||||||
//inner processing
|
//inner processing
|
||||||
virtual TResources estimateIncome() const;
|
virtual TResources estimateIncome() const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user