|
@@ -35,7 +35,7 @@ class AIStatus
|
|
|
BattleState battle;
|
|
|
std::map<QueryID, std::string> remainingQueries;
|
|
|
std::map<int, QueryID> requestToQueryID; //IDs of answer-requests sent to server => query ids (so we can match answer confirmation from server to the query)
|
|
|
- std::vector<const CGObjectInstance*> objectsBeingVisited;
|
|
|
+ std::vector<const CGObjectInstance *> objectsBeingVisited;
|
|
|
bool ongoingHeroMovement;
|
|
|
bool ongoingChannelProbing; // true if AI currently explore bidirectional teleport channel exits
|
|
|
|
|
@@ -58,10 +58,10 @@ public:
|
|
|
bool haveTurn();
|
|
|
void attemptedAnsweringQuery(QueryID queryID, int answerRequestID);
|
|
|
void receivedAnswerConfirmation(int answerRequestID, int result);
|
|
|
- void heroVisit(const CGObjectInstance *obj, bool started);
|
|
|
+ void heroVisit(const CGObjectInstance * obj, bool started);
|
|
|
|
|
|
|
|
|
- template <typename Handler> void serialize(Handler &h, const int version)
|
|
|
+ template<typename Handler> void serialize(Handler & h, const int version)
|
|
|
{
|
|
|
h & battle;
|
|
|
h & remainingQueries;
|
|
@@ -70,7 +70,12 @@ public:
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-enum {NOT_VISIBLE = 0, NOT_CHECKED = 1, NOT_AVAILABLE};
|
|
|
+enum
|
|
|
+{
|
|
|
+ NOT_VISIBLE = 0,
|
|
|
+ NOT_CHECKED = 1,
|
|
|
+ NOT_AVAILABLE
|
|
|
+};
|
|
|
|
|
|
struct SectorMap
|
|
|
{
|
|
@@ -98,7 +103,7 @@ struct SectorMap
|
|
|
//std::vector<std::vector<std::vector<unsigned char>>> pathfinderSector;
|
|
|
|
|
|
std::map<int, Sector> infoOnSectors;
|
|
|
- std::shared_ptr<boost::multi_array<TerrainTile*, 3>> visibleTiles;
|
|
|
+ std::shared_ptr<boost::multi_array<TerrainTile *, 3>> visibleTiles;
|
|
|
|
|
|
SectorMap();
|
|
|
SectorMap(HeroPtr h);
|
|
@@ -107,12 +112,12 @@ struct SectorMap
|
|
|
void exploreNewSector(crint3 pos, int num, CCallback * cbp);
|
|
|
void write(crstring fname);
|
|
|
|
|
|
- bool markIfBlocked(TSectorID &sec, crint3 pos, const TerrainTile *t);
|
|
|
- bool markIfBlocked(TSectorID &sec, crint3 pos);
|
|
|
+ bool markIfBlocked(TSectorID & sec, crint3 pos, const TerrainTile * t);
|
|
|
+ bool markIfBlocked(TSectorID & sec, crint3 pos);
|
|
|
TSectorID & retrieveTile(crint3 pos);
|
|
|
TSectorID & retrieveTileN(TSectorArray & vectors, const int3 & pos);
|
|
|
- const TSectorID & retrieveTileN(const TSectorArray &vectors, const int3 &pos);
|
|
|
- TerrainTile* getTile(crint3 pos) const;
|
|
|
+ const TSectorID & retrieveTileN(const TSectorArray & vectors, const int3 & pos);
|
|
|
+ TerrainTile * getTile(crint3 pos) const;
|
|
|
std::vector<const CGObjectInstance *> getNearbyObjs(HeroPtr h, bool sectorsAround);
|
|
|
|
|
|
void makeParentBFS(crint3 source);
|
|
@@ -128,25 +133,25 @@ public:
|
|
|
|
|
|
//try build an unbuilt structure in maxDays at most (0 = indefinite)
|
|
|
/*bool canBuildStructure(const CGTownInstance * t, BuildingID building, unsigned int maxDays=7);*/
|
|
|
- bool tryBuildStructure(const CGTownInstance * t, BuildingID building, unsigned int maxDays=7);
|
|
|
+ bool tryBuildStructure(const CGTownInstance * t, BuildingID building, unsigned int maxDays = 7);
|
|
|
//try build ANY unbuilt structure
|
|
|
- BuildingID canBuildAnyStructure(const CGTownInstance * t, std::vector<BuildingID> buildList, unsigned int maxDays=7);
|
|
|
- bool tryBuildAnyStructure(const CGTownInstance * t, std::vector<BuildingID> buildList, unsigned int maxDays=7);
|
|
|
+ BuildingID canBuildAnyStructure(const CGTownInstance * t, std::vector<BuildingID> buildList, unsigned int maxDays = 7);
|
|
|
+ bool tryBuildAnyStructure(const CGTownInstance * t, std::vector<BuildingID> buildList, unsigned int maxDays = 7);
|
|
|
//try build first unbuilt structure
|
|
|
- bool tryBuildNextStructure(const CGTownInstance * t, std::vector<BuildingID> buildList, unsigned int maxDays=7);
|
|
|
+ bool tryBuildNextStructure(const CGTownInstance * t, std::vector<BuildingID> buildList, unsigned int maxDays = 7);
|
|
|
|
|
|
friend class FuzzyHelper;
|
|
|
|
|
|
- std::map<TeleportChannelID, std::shared_ptr<TeleportChannel> > knownTeleportChannels;
|
|
|
+ std::map<TeleportChannelID, std::shared_ptr<TeleportChannel>> knownTeleportChannels;
|
|
|
std::map<const CGObjectInstance *, const CGObjectInstance *> knownSubterraneanGates;
|
|
|
ObjectInstanceID destinationTeleport;
|
|
|
int3 destinationTeleportPos;
|
|
|
std::vector<ObjectInstanceID> teleportChannelProbingList; //list of teleport channel exits that not visible and need to be (re-)explored
|
|
|
//std::vector<const CGObjectInstance *> visitedThisWeek; //only OPWs
|
|
|
- std::map<HeroPtr, std::set<const CGTownInstance *> > townVisitsThisWeek;
|
|
|
+ std::map<HeroPtr, std::set<const CGTownInstance *>> townVisitsThisWeek;
|
|
|
|
|
|
std::map<HeroPtr, Goals::TSubgoal> lockedHeroes; //TODO: allow non-elementar objectives
|
|
|
- std::map<HeroPtr, std::set<const CGObjectInstance *> > reservedHeroesMap; //objects reserved by specific heroes
|
|
|
+ std::map<HeroPtr, std::set<const CGObjectInstance *>> reservedHeroesMap; //objects reserved by specific heroes
|
|
|
std::set<HeroPtr> heroesUnableToExplore; //these heroes will not be polled for exploration in current state of game
|
|
|
|
|
|
//sets are faster to search, also do not contain duplicates
|
|
@@ -154,7 +159,7 @@ public:
|
|
|
std::set<const CGObjectInstance *> alreadyVisited;
|
|
|
std::set<const CGObjectInstance *> reservedObjs; //to be visited by specific hero
|
|
|
|
|
|
- std::map <HeroPtr, std::shared_ptr<SectorMap>> cachedSectorMaps; //TODO: serialize? not necessary
|
|
|
+ std::map<HeroPtr, std::shared_ptr<SectorMap>> cachedSectorMaps; //TODO: serialize? not necessary
|
|
|
|
|
|
TResources saving;
|
|
|
|
|
@@ -191,62 +196,62 @@ public:
|
|
|
virtual void init(std::shared_ptr<CCallback> CB) override;
|
|
|
virtual void yourTurn() override;
|
|
|
|
|
|
- virtual void heroGotLevel(const CGHeroInstance *hero, PrimarySkill::PrimarySkill pskill, std::vector<SecondarySkill> &skills, QueryID queryID) override; //pskill is gained primary skill, interface has to choose one of given skills and call callback with selection id
|
|
|
- virtual void commanderGotLevel (const CCommanderInstance * commander, std::vector<ui32> skills, QueryID queryID) override; //TODO
|
|
|
- virtual void showBlockingDialog(const std::string &text, const std::vector<Component> &components, QueryID askID, const int soundID, bool selection, bool cancel) override; //Show a dialog, player must take decision. If selection then he has to choose between one of given components, if cancel he is allowed to not choose. After making choice, CCallback::selectionMade should be called with number of selected component (1 - n) or 0 for cancel (if allowed) and askID.
|
|
|
- virtual void showGarrisonDialog(const CArmedInstance *up, const CGHeroInstance *down, bool removableUnits, QueryID queryID) override; //all stacks operations between these objects become allowed, interface has to call onEnd when done
|
|
|
+ virtual void heroGotLevel(const CGHeroInstance * hero, PrimarySkill::PrimarySkill pskill, std::vector<SecondarySkill> & skills, QueryID queryID) override; //pskill is gained primary skill, interface has to choose one of given skills and call callback with selection id
|
|
|
+ virtual void commanderGotLevel(const CCommanderInstance * commander, std::vector<ui32> skills, QueryID queryID) override; //TODO
|
|
|
+ virtual void showBlockingDialog(const std::string & text, const std::vector<Component> & components, QueryID askID, const int soundID, bool selection, bool cancel) override; //Show a dialog, player must take decision. If selection then he has to choose between one of given components, if cancel he is allowed to not choose. After making choice, CCallback::selectionMade should be called with number of selected component (1 - n) or 0 for cancel (if allowed) and askID.
|
|
|
+ virtual void showGarrisonDialog(const CArmedInstance * up, const CGHeroInstance * down, bool removableUnits, QueryID queryID) override; //all stacks operations between these objects become allowed, interface has to call onEnd when done
|
|
|
virtual void showTeleportDialog(TeleportChannelID channel, TTeleportExitsList exits, bool impassable, QueryID askID) override;
|
|
|
void showMapObjectSelectDialog(QueryID askID, const Component & icon, const MetaString & title, const MetaString & description, const std::vector<ObjectInstanceID> & objects) override;
|
|
|
virtual void saveGame(BinarySerializer & h, const int version) override; //saving
|
|
|
virtual void loadGame(BinaryDeserializer & h, const int version) override; //loading
|
|
|
virtual void finish() override;
|
|
|
|
|
|
- virtual void availableCreaturesChanged(const CGDwelling *town) override;
|
|
|
+ virtual void availableCreaturesChanged(const CGDwelling * town) override;
|
|
|
virtual void heroMoved(const TryMoveHero & details) override;
|
|
|
- virtual void heroInGarrisonChange(const CGTownInstance *town) override;
|
|
|
+ virtual void heroInGarrisonChange(const CGTownInstance * town) override;
|
|
|
virtual void centerView(int3 pos, int focusTime) override;
|
|
|
- virtual void tileHidden(const std::unordered_set<int3, ShashInt3> &pos) override;
|
|
|
- virtual void artifactMoved(const ArtifactLocation &src, const ArtifactLocation &dst) override;
|
|
|
- virtual void artifactAssembled(const ArtifactLocation &al) override;
|
|
|
- virtual void showTavernWindow(const CGObjectInstance *townOrTavern) override;
|
|
|
- virtual void showThievesGuildWindow (const CGObjectInstance * obj) override;
|
|
|
+ virtual void tileHidden(const std::unordered_set<int3, ShashInt3> & pos) override;
|
|
|
+ virtual void artifactMoved(const ArtifactLocation & src, const ArtifactLocation & dst) override;
|
|
|
+ virtual void artifactAssembled(const ArtifactLocation & al) override;
|
|
|
+ virtual void showTavernWindow(const CGObjectInstance * townOrTavern) override;
|
|
|
+ virtual void showThievesGuildWindow(const CGObjectInstance * obj) override;
|
|
|
virtual void playerBlocked(int reason, bool start) override;
|
|
|
virtual void showPuzzleMap() override;
|
|
|
- virtual void showShipyardDialog(const IShipyard *obj) override;
|
|
|
+ virtual void showShipyardDialog(const IShipyard * obj) override;
|
|
|
virtual void gameOver(PlayerColor player, const EVictoryLossCheckResult & victoryLossCheckResult) override;
|
|
|
- virtual void artifactPut(const ArtifactLocation &al) override;
|
|
|
- virtual void artifactRemoved(const ArtifactLocation &al) override;
|
|
|
- virtual void artifactDisassembled(const ArtifactLocation &al) override;
|
|
|
- virtual void heroVisit(const CGHeroInstance *visitor, const CGObjectInstance *visitedObj, bool start) override;
|
|
|
- virtual void availableArtifactsChanged(const CGBlackMarket *bm = nullptr) override;
|
|
|
- virtual void heroVisitsTown(const CGHeroInstance* hero, const CGTownInstance * town) override;
|
|
|
- virtual void tileRevealed(const std::unordered_set<int3, ShashInt3> &pos) override;
|
|
|
+ virtual void artifactPut(const ArtifactLocation & al) override;
|
|
|
+ virtual void artifactRemoved(const ArtifactLocation & al) override;
|
|
|
+ virtual void artifactDisassembled(const ArtifactLocation & al) override;
|
|
|
+ virtual void heroVisit(const CGHeroInstance * visitor, const CGObjectInstance * visitedObj, bool start) override;
|
|
|
+ virtual void availableArtifactsChanged(const CGBlackMarket * bm = nullptr) override;
|
|
|
+ virtual void heroVisitsTown(const CGHeroInstance * hero, const CGTownInstance * town) override;
|
|
|
+ virtual void tileRevealed(const std::unordered_set<int3, ShashInt3> & pos) override;
|
|
|
virtual void heroExchangeStarted(ObjectInstanceID hero1, ObjectInstanceID hero2, QueryID query) override;
|
|
|
virtual void heroPrimarySkillChanged(const CGHeroInstance * hero, int which, si64 val) override;
|
|
|
- virtual void showRecruitmentDialog(const CGDwelling *dwelling, const CArmedInstance *dst, int level) override;
|
|
|
+ virtual void showRecruitmentDialog(const CGDwelling * dwelling, const CArmedInstance * dst, int level) override;
|
|
|
virtual void heroMovePointsChanged(const CGHeroInstance * hero) override;
|
|
|
virtual void garrisonsChanged(ObjectInstanceID id1, ObjectInstanceID id2) override;
|
|
|
virtual void newObject(const CGObjectInstance * obj) override;
|
|
|
- virtual void showHillFortWindow(const CGObjectInstance *object, const CGHeroInstance *visitor) override;
|
|
|
- virtual void playerBonusChanged(const Bonus &bonus, bool gain) override;
|
|
|
- virtual void heroCreated(const CGHeroInstance*) override;
|
|
|
+ virtual void showHillFortWindow(const CGObjectInstance * object, const CGHeroInstance * visitor) override;
|
|
|
+ virtual void playerBonusChanged(const Bonus & bonus, bool gain) override;
|
|
|
+ virtual void heroCreated(const CGHeroInstance *) override;
|
|
|
virtual void advmapSpellCast(const CGHeroInstance * caster, int spellID) override;
|
|
|
- virtual void showInfoDialog(const std::string &text, const std::vector<Component> &components, int soundID) override;
|
|
|
- virtual void requestRealized(PackageApplied *pa) override;
|
|
|
+ virtual void showInfoDialog(const std::string & text, const std::vector<Component> & components, int soundID) override;
|
|
|
+ virtual void requestRealized(PackageApplied * pa) override;
|
|
|
virtual void receivedResource() override;
|
|
|
- virtual void objectRemoved(const CGObjectInstance *obj) override;
|
|
|
- virtual void showUniversityWindow(const IMarket *market, const CGHeroInstance *visitor) override;
|
|
|
+ virtual void objectRemoved(const CGObjectInstance * obj) override;
|
|
|
+ virtual void showUniversityWindow(const IMarket * market, const CGHeroInstance * visitor) override;
|
|
|
virtual void heroManaPointsChanged(const CGHeroInstance * hero) override;
|
|
|
virtual void heroSecondarySkillChanged(const CGHeroInstance * hero, int which, int val) override;
|
|
|
virtual void battleResultsApplied() override;
|
|
|
virtual void objectPropertyChanged(const SetObjectProperty * sop) override;
|
|
|
- virtual void buildChanged(const CGTownInstance *town, BuildingID buildingID, int what) override;
|
|
|
- virtual void heroBonusChanged(const CGHeroInstance *hero, const Bonus &bonus, bool gain) override;
|
|
|
- virtual void showMarketWindow(const IMarket *market, const CGHeroInstance *visitor) override;
|
|
|
+ virtual void buildChanged(const CGTownInstance * town, BuildingID buildingID, int what) override;
|
|
|
+ virtual void heroBonusChanged(const CGHeroInstance * hero, const Bonus & bonus, bool gain) override;
|
|
|
+ virtual void showMarketWindow(const IMarket * market, const CGHeroInstance * visitor) override;
|
|
|
void showWorldViewEx(const std::vector<ObjectPosInfo> & objectPositions) override;
|
|
|
|
|
|
- virtual void battleStart(const CCreatureSet *army1, const CCreatureSet *army2, int3 tile, const CGHeroInstance *hero1, const CGHeroInstance *hero2, bool side) override;
|
|
|
- virtual void battleEnd(const BattleResult *br) override;
|
|
|
+ virtual void battleStart(const CCreatureSet * army1, const CCreatureSet * army2, int3 tile, const CGHeroInstance * hero1, const CGHeroInstance * hero2, bool side) override;
|
|
|
+ virtual void battleEnd(const BattleResult * br) override;
|
|
|
void makeTurn();
|
|
|
|
|
|
void makeTurnInternal();
|
|
@@ -259,15 +264,15 @@ public:
|
|
|
void wander(HeroPtr h);
|
|
|
void setGoal(HeroPtr h, Goals::TSubgoal goal);
|
|
|
void evaluateGoal(HeroPtr h); //evaluates goal assigned to hero, if any
|
|
|
- void completeGoal (Goals::TSubgoal goal); //safely removes goal from reserved hero
|
|
|
- void striveToQuest (const QuestInfo &q);
|
|
|
+ void completeGoal(Goals::TSubgoal goal); //safely removes goal from reserved hero
|
|
|
+ void striveToQuest(const QuestInfo & q);
|
|
|
|
|
|
void recruitHero(const CGTownInstance * t, bool throwing = false);
|
|
|
- bool isGoodForVisit(const CGObjectInstance *obj, HeroPtr h, SectorMap &sm);
|
|
|
+ bool isGoodForVisit(const CGObjectInstance * obj, HeroPtr h, SectorMap & sm);
|
|
|
void buildStructure(const CGTownInstance * t);
|
|
|
//void recruitCreatures(const CGTownInstance * t);
|
|
|
void recruitCreatures(const CGDwelling * d, const CArmedInstance * recruiter);
|
|
|
- bool canGetArmy (const CGHeroInstance * h, const CGHeroInstance * source); //can we get any better stacks from other hero?
|
|
|
+ bool canGetArmy(const CGHeroInstance * h, const CGHeroInstance * source); //can we get any better stacks from other hero?
|
|
|
void pickBestCreatures(const CArmedInstance * army, const CArmedInstance * source); //called when we can't find a slot for new stack
|
|
|
void pickBestArtifacts(const CGHeroInstance * h, const CGHeroInstance * other = nullptr);
|
|
|
void moveCreaturesToHero(const CGTownInstance * t);
|
|
@@ -279,52 +284,52 @@ public:
|
|
|
void lostHero(HeroPtr h); //should remove all references to hero (assigned tasks and so on)
|
|
|
void waitTillFree();
|
|
|
|
|
|
- void addVisitableObj(const CGObjectInstance *obj);
|
|
|
- void markObjectVisited (const CGObjectInstance *obj);
|
|
|
- void reserveObject (HeroPtr h, const CGObjectInstance *obj); //TODO: reserve all objects that heroes attempt to visit
|
|
|
- void unreserveObject (HeroPtr h, const CGObjectInstance *obj);
|
|
|
+ void addVisitableObj(const CGObjectInstance * obj);
|
|
|
+ void markObjectVisited(const CGObjectInstance * obj);
|
|
|
+ void reserveObject(HeroPtr h, const CGObjectInstance * obj); //TODO: reserve all objects that heroes attempt to visit
|
|
|
+ void unreserveObject(HeroPtr h, const CGObjectInstance * obj);
|
|
|
|
|
|
- void markHeroUnableToExplore (HeroPtr h);
|
|
|
- void markHeroAbleToExplore (HeroPtr h);
|
|
|
- bool isAbleToExplore (HeroPtr h);
|
|
|
+ void markHeroUnableToExplore(HeroPtr h);
|
|
|
+ void markHeroAbleToExplore(HeroPtr h);
|
|
|
+ bool isAbleToExplore(HeroPtr h);
|
|
|
void clearPathsInfo();
|
|
|
|
|
|
- void validateObject(const CGObjectInstance *obj); //checks if object is still visible and if not, removes references to it
|
|
|
+ void validateObject(const CGObjectInstance * obj); //checks if object is still visible and if not, removes references to it
|
|
|
void validateObject(ObjectIdRef obj); //checks if object is still visible and if not, removes references to it
|
|
|
void validateVisitableObjs();
|
|
|
- void retrieveVisitableObjs(std::vector<const CGObjectInstance *> &out, bool includeOwned = false) const;
|
|
|
+ void retrieveVisitableObjs(std::vector<const CGObjectInstance *> & out, bool includeOwned = false) const;
|
|
|
void retrieveVisitableObjs();
|
|
|
std::vector<const CGObjectInstance *> getFlaggedObjects() const;
|
|
|
|
|
|
- const CGObjectInstance *lookForArt(int aid) const;
|
|
|
- bool isAccessible(const int3 &pos);
|
|
|
+ const CGObjectInstance * lookForArt(int aid) const;
|
|
|
+ bool isAccessible(const int3 & pos);
|
|
|
HeroPtr getHeroWithGrail() const;
|
|
|
|
|
|
- const CGObjectInstance *getUnvisitedObj(const std::function<bool(const CGObjectInstance *)> &predicate);
|
|
|
+ const CGObjectInstance * getUnvisitedObj(const std::function<bool(const CGObjectInstance *)> & predicate);
|
|
|
bool isAccessibleForHero(const int3 & pos, HeroPtr h, bool includeAllies = false) const;
|
|
|
//optimization - use one SM for every hero call
|
|
|
std::shared_ptr<SectorMap> getCachedSectorMap(HeroPtr h);
|
|
|
|
|
|
- const CGTownInstance *findTownWithTavern() const;
|
|
|
+ const CGTownInstance * findTownWithTavern() const;
|
|
|
bool canRecruitAnyHero(const CGTownInstance * t = NULL) const;
|
|
|
|
|
|
- Goals::TSubgoal getGoal (HeroPtr h) const;
|
|
|
+ Goals::TSubgoal getGoal(HeroPtr h) const;
|
|
|
bool canAct(HeroPtr h) const;
|
|
|
std::vector<HeroPtr> getUnblockedHeroes() const;
|
|
|
HeroPtr primaryHero() const;
|
|
|
TResources freeResources() const; //owned resources minus gold reserve
|
|
|
TResources estimateIncome() const;
|
|
|
- bool containsSavedRes(const TResources &cost) const;
|
|
|
- void checkHeroArmy (HeroPtr h);
|
|
|
+ bool containsSavedRes(const TResources & cost) const;
|
|
|
+ void checkHeroArmy(HeroPtr h);
|
|
|
|
|
|
- void requestSent(const CPackForServer *pack, int requestID) override;
|
|
|
+ void requestSent(const CPackForServer * pack, int requestID) override;
|
|
|
void answerQuery(QueryID queryID, int selection);
|
|
|
//special function that can be called ONLY from game events handling thread and will send request ASAP
|
|
|
void requestActionASAP(std::function<void()> whatToDo);
|
|
|
|
|
|
#if 0
|
|
|
//disabled due to issue 2890
|
|
|
- template <typename Handler> void registerGoals(Handler &h)
|
|
|
+ template<typename Handler> void registerGoals(Handler & h)
|
|
|
{
|
|
|
//h.template registerType<Goals::AbstractGoal, Goals::BoostHero>();
|
|
|
h.template registerType<Goals::AbstractGoal, Goals::Build>();
|
|
@@ -349,7 +354,7 @@ public:
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
- template <typename Handler> void serializeInternal(Handler &h, const int version)
|
|
|
+ template<typename Handler> void serializeInternal(Handler & h, const int version)
|
|
|
{
|
|
|
h & knownTeleportChannels;
|
|
|
h & knownSubterraneanGates;
|
|
@@ -413,8 +418,10 @@ public:
|
|
|
class cannotFulfillGoalException : public std::exception
|
|
|
{
|
|
|
std::string msg;
|
|
|
+
|
|
|
public:
|
|
|
- explicit cannotFulfillGoalException(crstring _Message) : msg(_Message)
|
|
|
+ explicit cannotFulfillGoalException(crstring _Message)
|
|
|
+ : msg(_Message)
|
|
|
{
|
|
|
}
|
|
|
|
|
@@ -422,18 +429,21 @@ public:
|
|
|
{
|
|
|
};
|
|
|
|
|
|
- const char *what() const throw () override
|
|
|
+ const char * what() const throw () override
|
|
|
{
|
|
|
return msg.c_str();
|
|
|
}
|
|
|
};
|
|
|
+
|
|
|
class goalFulfilledException : public std::exception
|
|
|
{
|
|
|
std::string msg;
|
|
|
+
|
|
|
public:
|
|
|
Goals::TSubgoal goal;
|
|
|
|
|
|
- explicit goalFulfilledException(Goals::TSubgoal Goal) : goal(Goal)
|
|
|
+ explicit goalFulfilledException(Goals::TSubgoal Goal)
|
|
|
+ : goal(Goal)
|
|
|
{
|
|
|
msg = goal->name();
|
|
|
}
|
|
@@ -442,11 +452,10 @@ public:
|
|
|
{
|
|
|
};
|
|
|
|
|
|
- const char *what() const throw () override
|
|
|
+ const char * what() const throw () override
|
|
|
{
|
|
|
return msg.c_str();
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-void makePossibleUpgrades(const CArmedInstance *obj);
|
|
|
-
|
|
|
+void makePossibleUpgrades(const CArmedInstance * obj);
|