From 678cacbd254710206f1843863310bfec8692f026 Mon Sep 17 00:00:00 2001 From: Alexander Wilms Date: Tue, 13 Feb 2024 15:21:30 +0100 Subject: [PATCH 1/2] Remove more redundant `virtual` specifiers `grep -nr "virtual " | grep -v googletest | grep " override" | grep -v overriden > ../redundant_virtual.txt` ```python import os with open("../redundant_virtual.txt") as f: for line in f: print() line: str = line.strip() print(line) tmp = line.split(":",2) file = tmp[0].strip() code = tmp[-1].strip() print(file) print(code) new_code = code.replace("virtual ", "", 1) # https://superuser.com/a/802490/578501 command = f"export FIND='{code}' && export REPLACE='{new_code}' && ruby -p -i -e \"gsub(ENV['FIND'], ENV['REPLACE'])\" {file}" os.system(command) ``` --- AI/Nullkiller/Behaviors/BuildingBehavior.h | 4 ++-- AI/Nullkiller/Behaviors/BuyArmyBehavior.h | 4 ++-- .../Behaviors/CaptureObjectsBehavior.h | 4 ++-- AI/Nullkiller/Behaviors/ClusterBehavior.h | 2 +- AI/Nullkiller/Behaviors/DefenceBehavior.h | 4 ++-- AI/Nullkiller/Behaviors/GatherArmyBehavior.h | 2 +- AI/Nullkiller/Behaviors/RecruitHeroBehavior.h | 2 +- AI/Nullkiller/Behaviors/StartupBehavior.h | 2 +- AI/Nullkiller/Behaviors/StayAtTownBehavior.h | 2 +- AI/Nullkiller/Engine/PriorityEvaluator.cpp | 18 +++++++++--------- AI/Nullkiller/Goals/BuildThis.h | 2 +- AI/Nullkiller/Goals/BuyArmy.h | 2 +- AI/Nullkiller/Goals/CGoal.h | 2 +- AI/Nullkiller/Goals/CaptureObject.h | 4 ++-- AI/Nullkiller/Goals/CompleteQuest.h | 4 ++-- AI/Nullkiller/Goals/Composition.h | 2 +- AI/Nullkiller/Goals/Invalid.h | 2 +- AI/Nullkiller/Goals/RecruitHero.h | 2 +- AI/Nullkiller/Goals/StayAtTown.h | 2 +- AI/Nullkiller/Markers/ArmyUpgrade.h | 2 +- AI/Nullkiller/Markers/DefendTown.h | 2 +- AI/Nullkiller/Markers/HeroExchange.h | 2 +- AI/Nullkiller/Markers/UnlockCluster.h | 2 +- AI/Nullkiller/Pathfinding/AINodeStorage.h | 2 +- .../AdventureSpellCastMovementActions.h | 2 +- .../Pathfinding/Actions/BattleAction.h | 2 +- .../Pathfinding/Actions/BoatActions.h | 6 +++--- .../Pathfinding/Actions/QuestAction.h | 4 ++-- .../Pathfinding/Actions/TownPortalAction.h | 2 +- AI/Nullkiller/Pathfinding/Actors.h | 6 +++--- AI/VCAI/Pathfinding/AINodeStorage.h | 2 +- AI/VCAI/Pathfinding/Actions/BattleAction.h | 2 +- AI/VCAI/Pathfinding/Actions/BoatActions.h | 4 ++-- AI/VCAI/Pathfinding/Actions/TownPortalAction.h | 2 +- lib/BattleFieldHandler.h | 4 ++-- lib/CCreatureSet.h | 2 +- lib/CGameInfoCallback.h | 2 +- lib/CGameInterface.h | 8 ++++---- lib/RiverHandler.h | 4 ++-- lib/RoadHandler.h | 4 ++-- lib/TerrainHandler.h | 4 ++-- lib/bonuses/Updaters.h | 10 +++++----- lib/pathfinder/NodeStorage.h | 2 +- lib/rmg/CRmgTemplateStorage.h | 4 ++-- 44 files changed, 76 insertions(+), 76 deletions(-) diff --git a/AI/Nullkiller/Behaviors/BuildingBehavior.h b/AI/Nullkiller/Behaviors/BuildingBehavior.h index 46d12dd13..4836d1cb0 100644 --- a/AI/Nullkiller/Behaviors/BuildingBehavior.h +++ b/AI/Nullkiller/Behaviors/BuildingBehavior.h @@ -25,8 +25,8 @@ namespace Goals { } - virtual Goals::TGoalVec decompose() const override; - virtual std::string toString() const override; + Goals::TGoalVec decompose() const override; + std::string toString() const override; bool operator==(const BuildingBehavior & other) const override { return true; diff --git a/AI/Nullkiller/Behaviors/BuyArmyBehavior.h b/AI/Nullkiller/Behaviors/BuyArmyBehavior.h index 2d6ea9f0d..909e7221c 100644 --- a/AI/Nullkiller/Behaviors/BuyArmyBehavior.h +++ b/AI/Nullkiller/Behaviors/BuyArmyBehavior.h @@ -24,8 +24,8 @@ namespace Goals { } - virtual Goals::TGoalVec decompose() const override; - virtual std::string toString() const override; + Goals::TGoalVec decompose() const override; + std::string toString() const override; bool operator==(const BuyArmyBehavior & other) const override { return true; diff --git a/AI/Nullkiller/Behaviors/CaptureObjectsBehavior.h b/AI/Nullkiller/Behaviors/CaptureObjectsBehavior.h index 1e29fb03c..09bdd8e0a 100644 --- a/AI/Nullkiller/Behaviors/CaptureObjectsBehavior.h +++ b/AI/Nullkiller/Behaviors/CaptureObjectsBehavior.h @@ -48,8 +48,8 @@ namespace Goals specificObjects = true; } - virtual Goals::TGoalVec decompose() const override; - virtual std::string toString() const override; + Goals::TGoalVec decompose() const override; + std::string toString() const override; CaptureObjectsBehavior & ofType(int type) { diff --git a/AI/Nullkiller/Behaviors/ClusterBehavior.h b/AI/Nullkiller/Behaviors/ClusterBehavior.h index 22c88f2ce..c19642a8d 100644 --- a/AI/Nullkiller/Behaviors/ClusterBehavior.h +++ b/AI/Nullkiller/Behaviors/ClusterBehavior.h @@ -29,7 +29,7 @@ namespace Goals } TGoalVec decompose() const override; - virtual std::string toString() const override; + std::string toString() const override; bool operator==(const ClusterBehavior & other) const override { diff --git a/AI/Nullkiller/Behaviors/DefenceBehavior.h b/AI/Nullkiller/Behaviors/DefenceBehavior.h index 1eb4ef682..18d577c66 100644 --- a/AI/Nullkiller/Behaviors/DefenceBehavior.h +++ b/AI/Nullkiller/Behaviors/DefenceBehavior.h @@ -29,8 +29,8 @@ namespace Goals { } - virtual Goals::TGoalVec decompose() const override; - virtual std::string toString() const override; + Goals::TGoalVec decompose() const override; + std::string toString() const override; bool operator==(const DefenceBehavior & other) const override { diff --git a/AI/Nullkiller/Behaviors/GatherArmyBehavior.h b/AI/Nullkiller/Behaviors/GatherArmyBehavior.h index 1ae2f3481..b2ef06113 100644 --- a/AI/Nullkiller/Behaviors/GatherArmyBehavior.h +++ b/AI/Nullkiller/Behaviors/GatherArmyBehavior.h @@ -26,7 +26,7 @@ namespace Goals } TGoalVec decompose() const override; - virtual std::string toString() const override; + std::string toString() const override; bool operator==(const GatherArmyBehavior & other) const override { diff --git a/AI/Nullkiller/Behaviors/RecruitHeroBehavior.h b/AI/Nullkiller/Behaviors/RecruitHeroBehavior.h index 103f25d50..e45c16e67 100644 --- a/AI/Nullkiller/Behaviors/RecruitHeroBehavior.h +++ b/AI/Nullkiller/Behaviors/RecruitHeroBehavior.h @@ -26,7 +26,7 @@ namespace Goals } TGoalVec decompose() const override; - virtual std::string toString() const override; + std::string toString() const override; bool operator==(const RecruitHeroBehavior & other) const override { diff --git a/AI/Nullkiller/Behaviors/StartupBehavior.h b/AI/Nullkiller/Behaviors/StartupBehavior.h index 8bfcc5734..0386b60a0 100644 --- a/AI/Nullkiller/Behaviors/StartupBehavior.h +++ b/AI/Nullkiller/Behaviors/StartupBehavior.h @@ -26,7 +26,7 @@ namespace Goals } TGoalVec decompose() const override; - virtual std::string toString() const override; + std::string toString() const override; bool operator==(const StartupBehavior & other) const override { diff --git a/AI/Nullkiller/Behaviors/StayAtTownBehavior.h b/AI/Nullkiller/Behaviors/StayAtTownBehavior.h index dd8363968..6287b85b0 100644 --- a/AI/Nullkiller/Behaviors/StayAtTownBehavior.h +++ b/AI/Nullkiller/Behaviors/StayAtTownBehavior.h @@ -26,7 +26,7 @@ namespace Goals } TGoalVec decompose() const override; - virtual std::string toString() const override; + std::string toString() const override; bool operator==(const StayAtTownBehavior & other) const override { diff --git a/AI/Nullkiller/Engine/PriorityEvaluator.cpp b/AI/Nullkiller/Engine/PriorityEvaluator.cpp index 8564f52fc..3540162c3 100644 --- a/AI/Nullkiller/Engine/PriorityEvaluator.cpp +++ b/AI/Nullkiller/Engine/PriorityEvaluator.cpp @@ -702,7 +702,7 @@ int32_t RewardEvaluator::getGoldReward(const CGObjectInstance * target, const CG class HeroExchangeEvaluator : public IEvaluationContextBuilder { public: - virtual void buildEvaluationContext(EvaluationContext & evaluationContext, Goals::TSubgoal task) const override + void buildEvaluationContext(EvaluationContext & evaluationContext, Goals::TSubgoal task) const override { if(task->goalType != Goals::HERO_EXCHANGE) return; @@ -719,7 +719,7 @@ public: class ArmyUpgradeEvaluator : public IEvaluationContextBuilder { public: - virtual void buildEvaluationContext(EvaluationContext & evaluationContext, Goals::TSubgoal task) const override + void buildEvaluationContext(EvaluationContext & evaluationContext, Goals::TSubgoal task) const override { if(task->goalType != Goals::ARMY_UPGRADE) return; @@ -736,7 +736,7 @@ public: class StayAtTownManaRecoveryEvaluator : public IEvaluationContextBuilder { public: - virtual void buildEvaluationContext(EvaluationContext & evaluationContext, Goals::TSubgoal task) const override + void buildEvaluationContext(EvaluationContext & evaluationContext, Goals::TSubgoal task) const override { if(task->goalType != Goals::STAY_AT_TOWN) return; @@ -771,7 +771,7 @@ void addTileDanger(EvaluationContext & evaluationContext, const int3 & tile, uin class DefendTownEvaluator : public IEvaluationContextBuilder { public: - virtual void buildEvaluationContext(EvaluationContext & evaluationContext, Goals::TSubgoal task) const override + void buildEvaluationContext(EvaluationContext & evaluationContext, Goals::TSubgoal task) const override { if(task->goalType != Goals::DEFEND_TOWN) return; @@ -821,7 +821,7 @@ private: public: ExecuteHeroChainEvaluationContextBuilder(const Nullkiller * ai) : ai(ai) {} - virtual void buildEvaluationContext(EvaluationContext & evaluationContext, Goals::TSubgoal task) const override + void buildEvaluationContext(EvaluationContext & evaluationContext, Goals::TSubgoal task) const override { if(task->goalType != Goals::EXECUTE_HERO_CHAIN) return; @@ -879,7 +879,7 @@ class ClusterEvaluationContextBuilder : public IEvaluationContextBuilder public: ClusterEvaluationContextBuilder(const Nullkiller * ai) {} - virtual void buildEvaluationContext(EvaluationContext & evaluationContext, Goals::TSubgoal task) const override + void buildEvaluationContext(EvaluationContext & evaluationContext, Goals::TSubgoal task) const override { if(task->goalType != Goals::UNLOCK_CLUSTER) return; @@ -926,7 +926,7 @@ public: class ExchangeSwapTownHeroesContextBuilder : public IEvaluationContextBuilder { public: - virtual void buildEvaluationContext(EvaluationContext & evaluationContext, Goals::TSubgoal task) const override + void buildEvaluationContext(EvaluationContext & evaluationContext, Goals::TSubgoal task) const override { if(task->goalType != Goals::EXCHANGE_SWAP_TOWN_HEROES) return; @@ -954,7 +954,7 @@ private: public: DismissHeroContextBuilder(const Nullkiller * ai) : ai(ai) {} - virtual void buildEvaluationContext(EvaluationContext & evaluationContext, Goals::TSubgoal task) const override + void buildEvaluationContext(EvaluationContext & evaluationContext, Goals::TSubgoal task) const override { if(task->goalType != Goals::DISMISS_HERO) return; @@ -974,7 +974,7 @@ public: class BuildThisEvaluationContextBuilder : public IEvaluationContextBuilder { public: - virtual void buildEvaluationContext(EvaluationContext & evaluationContext, Goals::TSubgoal task) const override + void buildEvaluationContext(EvaluationContext & evaluationContext, Goals::TSubgoal task) const override { if(task->goalType != Goals::BUILD_STRUCTURE) return; diff --git a/AI/Nullkiller/Goals/BuildThis.h b/AI/Nullkiller/Goals/BuildThis.h index 0b85108b6..02b93c2ab 100644 --- a/AI/Nullkiller/Goals/BuildThis.h +++ b/AI/Nullkiller/Goals/BuildThis.h @@ -40,7 +40,7 @@ namespace Goals BuildThis(BuildingID Bid, const CGTownInstance * tid); bool operator==(const BuildThis & other) const override; - virtual std::string toString() const override; + std::string toString() const override; void accept(AIGateway * ai) override; }; } diff --git a/AI/Nullkiller/Goals/BuyArmy.h b/AI/Nullkiller/Goals/BuyArmy.h index bd1080fd9..1de8f57ce 100644 --- a/AI/Nullkiller/Goals/BuyArmy.h +++ b/AI/Nullkiller/Goals/BuyArmy.h @@ -38,7 +38,7 @@ namespace Goals bool operator==(const BuyArmy & other) const override; - virtual std::string toString() const override; + std::string toString() const override; void accept(AIGateway * ai) override; }; diff --git a/AI/Nullkiller/Goals/CGoal.h b/AI/Nullkiller/Goals/CGoal.h index 8aa5b90ad..92e4a92a2 100644 --- a/AI/Nullkiller/Goals/CGoal.h +++ b/AI/Nullkiller/Goals/CGoal.h @@ -92,7 +92,7 @@ namespace Goals bool isElementar() const override { return true; } - virtual HeroPtr getHero() const override { return AbstractGoal::hero; } + HeroPtr getHero() const override { return AbstractGoal::hero; } int getHeroExchangeCount() const override { return 0; } }; diff --git a/AI/Nullkiller/Goals/CaptureObject.h b/AI/Nullkiller/Goals/CaptureObject.h index 5ef3a8d51..2b3c339d6 100644 --- a/AI/Nullkiller/Goals/CaptureObject.h +++ b/AI/Nullkiller/Goals/CaptureObject.h @@ -35,8 +35,8 @@ namespace Goals } bool operator==(const CaptureObject & other) const override; - virtual Goals::TGoalVec decompose() const override; - virtual std::string toString() const override; + Goals::TGoalVec decompose() const override; + std::string toString() const override; bool hasHash() const override { return true; } uint64_t getHash() const override; }; diff --git a/AI/Nullkiller/Goals/CompleteQuest.h b/AI/Nullkiller/Goals/CompleteQuest.h index e7e0f3386..57b9fb236 100644 --- a/AI/Nullkiller/Goals/CompleteQuest.h +++ b/AI/Nullkiller/Goals/CompleteQuest.h @@ -29,8 +29,8 @@ namespace Goals { } - virtual Goals::TGoalVec decompose() const override; - virtual std::string toString() const override; + Goals::TGoalVec decompose() const override; + std::string toString() const override; bool hasHash() const override { return true; } uint64_t getHash() const override; diff --git a/AI/Nullkiller/Goals/Composition.h b/AI/Nullkiller/Goals/Composition.h index 72bf4e9bb..a45d1327a 100644 --- a/AI/Nullkiller/Goals/Composition.h +++ b/AI/Nullkiller/Goals/Composition.h @@ -27,7 +27,7 @@ namespace Goals } bool operator==(const Composition & other) const override; - virtual std::string toString() const override; + std::string toString() const override; void accept(AIGateway * ai) override; Composition & addNext(const AbstractGoal & goal); Composition & addNext(TSubgoal goal); diff --git a/AI/Nullkiller/Goals/Invalid.h b/AI/Nullkiller/Goals/Invalid.h index 9c02e3091..5447b34b4 100644 --- a/AI/Nullkiller/Goals/Invalid.h +++ b/AI/Nullkiller/Goals/Invalid.h @@ -37,7 +37,7 @@ namespace Goals return true; } - virtual std::string toString() const override + std::string toString() const override { return "Invalid"; } diff --git a/AI/Nullkiller/Goals/RecruitHero.h b/AI/Nullkiller/Goals/RecruitHero.h index 243f1f6d2..101588f19 100644 --- a/AI/Nullkiller/Goals/RecruitHero.h +++ b/AI/Nullkiller/Goals/RecruitHero.h @@ -43,7 +43,7 @@ namespace Goals return true; } - virtual std::string toString() const override; + std::string toString() const override; void accept(AIGateway * ai) override; }; } diff --git a/AI/Nullkiller/Goals/StayAtTown.h b/AI/Nullkiller/Goals/StayAtTown.h index 28aa607a2..9d90037b2 100644 --- a/AI/Nullkiller/Goals/StayAtTown.h +++ b/AI/Nullkiller/Goals/StayAtTown.h @@ -27,7 +27,7 @@ namespace Goals StayAtTown(const CGTownInstance * town, AIPath & path); bool operator==(const StayAtTown & other) const override; - virtual std::string toString() const override; + std::string toString() const override; void accept(AIGateway * ai) override; float getMovementWasted() const { return movementWasted; } }; diff --git a/AI/Nullkiller/Markers/ArmyUpgrade.h b/AI/Nullkiller/Markers/ArmyUpgrade.h index 6f67a3ba4..5ede01e80 100644 --- a/AI/Nullkiller/Markers/ArmyUpgrade.h +++ b/AI/Nullkiller/Markers/ArmyUpgrade.h @@ -30,7 +30,7 @@ namespace Goals ArmyUpgrade(const CGHeroInstance * targetMain, const CGObjectInstance * upgrader, const ArmyUpgradeInfo & upgrade); bool operator==(const ArmyUpgrade & other) const override; - virtual std::string toString() const override; + std::string toString() const override; uint64_t getUpgradeValue() const { return upgradeValue; } uint64_t getInitialArmyValue() const { return initialValue; } diff --git a/AI/Nullkiller/Markers/DefendTown.h b/AI/Nullkiller/Markers/DefendTown.h index 30ec60d9d..f03f84036 100644 --- a/AI/Nullkiller/Markers/DefendTown.h +++ b/AI/Nullkiller/Markers/DefendTown.h @@ -31,7 +31,7 @@ namespace Goals DefendTown(const CGTownInstance * town, const HitMapInfo & treat, const CGHeroInstance * defender); bool operator==(const DefendTown & other) const override; - virtual std::string toString() const override; + std::string toString() const override; const HitMapInfo & getTreat() const { return treat; } diff --git a/AI/Nullkiller/Markers/HeroExchange.h b/AI/Nullkiller/Markers/HeroExchange.h index fb6be8af9..95546716d 100644 --- a/AI/Nullkiller/Markers/HeroExchange.h +++ b/AI/Nullkiller/Markers/HeroExchange.h @@ -29,7 +29,7 @@ namespace Goals } bool operator==(const HeroExchange & other) const override; - virtual std::string toString() const override; + std::string toString() const override; uint64_t getReinforcementArmyStrength() const; }; diff --git a/AI/Nullkiller/Markers/UnlockCluster.h b/AI/Nullkiller/Markers/UnlockCluster.h index db0ce7658..e504a3318 100644 --- a/AI/Nullkiller/Markers/UnlockCluster.h +++ b/AI/Nullkiller/Markers/UnlockCluster.h @@ -37,7 +37,7 @@ namespace Goals } bool operator==(const UnlockCluster & other) const override; - virtual std::string toString() const override; + std::string toString() const override; std::shared_ptr getCluster() const { return cluster; } const AIPath & getPathToCenter() { return pathToCenter; } }; diff --git a/AI/Nullkiller/Pathfinding/AINodeStorage.h b/AI/Nullkiller/Pathfinding/AINodeStorage.h index a8458939c..c986f080f 100644 --- a/AI/Nullkiller/Pathfinding/AINodeStorage.h +++ b/AI/Nullkiller/Pathfinding/AINodeStorage.h @@ -188,7 +188,7 @@ public: bool selectFirstActor(); bool selectNextActor(); - virtual std::vector getInitialNodes() override; + std::vector getInitialNodes() override; virtual std::vector calculateNeighbours( const PathNodeInfo & source, diff --git a/AI/Nullkiller/Pathfinding/Actions/AdventureSpellCastMovementActions.h b/AI/Nullkiller/Pathfinding/Actions/AdventureSpellCastMovementActions.h index 64f48aa0e..7defcebf0 100644 --- a/AI/Nullkiller/Pathfinding/Actions/AdventureSpellCastMovementActions.h +++ b/AI/Nullkiller/Pathfinding/Actions/AdventureSpellCastMovementActions.h @@ -40,7 +40,7 @@ namespace AIPathfinding bool canAct(const AIPathNode * source) const override; - virtual std::string toString() const override; + std::string toString() const override; }; class WaterWalkingAction : public AdventureCastAction diff --git a/AI/Nullkiller/Pathfinding/Actions/BattleAction.h b/AI/Nullkiller/Pathfinding/Actions/BattleAction.h index d5acb9209..838ba54c2 100644 --- a/AI/Nullkiller/Pathfinding/Actions/BattleAction.h +++ b/AI/Nullkiller/Pathfinding/Actions/BattleAction.h @@ -30,7 +30,7 @@ namespace AIPathfinding void execute(const CGHeroInstance * hero) const override; - virtual std::string toString() const override; + std::string toString() const override; }; } diff --git a/AI/Nullkiller/Pathfinding/Actions/BoatActions.h b/AI/Nullkiller/Pathfinding/Actions/BoatActions.h index cb8d32506..2a4dd67de 100644 --- a/AI/Nullkiller/Pathfinding/Actions/BoatActions.h +++ b/AI/Nullkiller/Pathfinding/Actions/BoatActions.h @@ -38,7 +38,7 @@ namespace AIPathfinding const ChainActor * getActor(const ChainActor * sourceActor) const override; - virtual std::string toString() const override; + std::string toString() const override; private: int32_t getManaCost(const CGHeroInstance * hero) const; @@ -60,11 +60,11 @@ namespace AIPathfinding void execute(const CGHeroInstance * hero) const override; - virtual Goals::TSubgoal decompose(const CGHeroInstance * hero) const override; + Goals::TSubgoal decompose(const CGHeroInstance * hero) const override; const ChainActor * getActor(const ChainActor * sourceActor) const override; - virtual std::string toString() const override; + std::string toString() const override; const CGObjectInstance * targetObject() const override; }; diff --git a/AI/Nullkiller/Pathfinding/Actions/QuestAction.h b/AI/Nullkiller/Pathfinding/Actions/QuestAction.h index 467932adc..52939e5f7 100644 --- a/AI/Nullkiller/Pathfinding/Actions/QuestAction.h +++ b/AI/Nullkiller/Pathfinding/Actions/QuestAction.h @@ -30,11 +30,11 @@ namespace AIPathfinding bool canAct(const AIPathNode * node) const override; - virtual Goals::TSubgoal decompose(const CGHeroInstance * hero) const override; + Goals::TSubgoal decompose(const CGHeroInstance * hero) const override; void execute(const CGHeroInstance * hero) const override; - virtual std::string toString() const override; + std::string toString() const override; }; } diff --git a/AI/Nullkiller/Pathfinding/Actions/TownPortalAction.h b/AI/Nullkiller/Pathfinding/Actions/TownPortalAction.h index 32795972f..05005156b 100644 --- a/AI/Nullkiller/Pathfinding/Actions/TownPortalAction.h +++ b/AI/Nullkiller/Pathfinding/Actions/TownPortalAction.h @@ -31,7 +31,7 @@ namespace AIPathfinding void execute(const CGHeroInstance * hero) const override; - virtual std::string toString() const override; + std::string toString() const override; }; } diff --git a/AI/Nullkiller/Pathfinding/Actors.h b/AI/Nullkiller/Pathfinding/Actors.h index 2947aa487..4451bda24 100644 --- a/AI/Nullkiller/Pathfinding/Actors.h +++ b/AI/Nullkiller/Pathfinding/Actors.h @@ -136,7 +136,7 @@ private: public: ObjectActor(const CGObjectInstance * obj, const CCreatureSet * army, uint64_t chainMask, int initialTurn); - virtual std::string toString() const override; + std::string toString() const override; const CGObjectInstance * getActorObject() const override; }; @@ -154,7 +154,7 @@ private: public: DwellingActor(const CGDwelling * dwelling, uint64_t chainMask, bool waitForGrowth, int dayOfWeek); ~DwellingActor(); - virtual std::string toString() const override; + std::string toString() const override; protected: int getInitialTurn(bool waitForGrowth, int dayOfWeek); @@ -168,7 +168,7 @@ private: public: TownGarrisonActor(const CGTownInstance * town, uint64_t chainMask); - virtual std::string toString() const override; + std::string toString() const override; }; } diff --git a/AI/VCAI/Pathfinding/AINodeStorage.h b/AI/VCAI/Pathfinding/AINodeStorage.h index 4b8118191..518972ed3 100644 --- a/AI/VCAI/Pathfinding/AINodeStorage.h +++ b/AI/VCAI/Pathfinding/AINodeStorage.h @@ -87,7 +87,7 @@ public: void initialize(const PathfinderOptions & options, const CGameState * gs) override; - virtual std::vector getInitialNodes() override; + std::vector getInitialNodes() override; virtual std::vector calculateNeighbours( const PathNodeInfo & source, diff --git a/AI/VCAI/Pathfinding/Actions/BattleAction.h b/AI/VCAI/Pathfinding/Actions/BattleAction.h index 630e49a55..dc3adb84e 100644 --- a/AI/VCAI/Pathfinding/Actions/BattleAction.h +++ b/AI/VCAI/Pathfinding/Actions/BattleAction.h @@ -25,6 +25,6 @@ namespace AIPathfinding { } - virtual Goals::TSubgoal whatToDo(const HeroPtr & hero) const override; + Goals::TSubgoal whatToDo(const HeroPtr & hero) const override; }; } \ No newline at end of file diff --git a/AI/VCAI/Pathfinding/Actions/BoatActions.h b/AI/VCAI/Pathfinding/Actions/BoatActions.h index 114478fcb..793a74486 100644 --- a/AI/VCAI/Pathfinding/Actions/BoatActions.h +++ b/AI/VCAI/Pathfinding/Actions/BoatActions.h @@ -40,7 +40,7 @@ namespace AIPathfinding { } - virtual Goals::TSubgoal whatToDo(const HeroPtr & hero) const override; + Goals::TSubgoal whatToDo(const HeroPtr & hero) const override; virtual void applyOnDestination( const CGHeroInstance * hero, @@ -66,6 +66,6 @@ namespace AIPathfinding { } - virtual Goals::TSubgoal whatToDo(const HeroPtr & hero) const override; + Goals::TSubgoal whatToDo(const HeroPtr & hero) const override; }; } diff --git a/AI/VCAI/Pathfinding/Actions/TownPortalAction.h b/AI/VCAI/Pathfinding/Actions/TownPortalAction.h index 8d587e052..eba21d392 100644 --- a/AI/VCAI/Pathfinding/Actions/TownPortalAction.h +++ b/AI/VCAI/Pathfinding/Actions/TownPortalAction.h @@ -27,6 +27,6 @@ namespace AIPathfinding { } - virtual Goals::TSubgoal whatToDo(const HeroPtr & hero) const override; + Goals::TSubgoal whatToDo(const HeroPtr & hero) const override; }; } diff --git a/lib/BattleFieldHandler.h b/lib/BattleFieldHandler.h index 126b4e3f9..b338cd772 100644 --- a/lib/BattleFieldHandler.h +++ b/lib/BattleFieldHandler.h @@ -70,8 +70,8 @@ public: const std::string & identifier, size_t index) override; - virtual const std::vector & getTypeNames() const override; - virtual std::vector loadLegacyData() override; + const std::vector & getTypeNames() const override; + std::vector loadLegacyData() override; }; VCMI_LIB_NAMESPACE_END diff --git a/lib/CCreatureSet.h b/lib/CCreatureSet.h index d84731c2e..10654b46a 100644 --- a/lib/CCreatureSet.h +++ b/lib/CCreatureSet.h @@ -127,7 +127,7 @@ public: ArtPlacementMap putArtifact(ArtifactPosition pos, CArtifactInstance * art) override;//from CArtifactSet void removeArtifact(ArtifactPosition pos) override; ArtBearer::ArtBearer bearerType() const override; //from CArtifactSet - virtual std::string nodeName() const override; //from CBonusSystemnode + std::string nodeName() const override; //from CBonusSystemnode void deserializationFix(); PlayerColor getOwner() const override; }; diff --git a/lib/CGameInfoCallback.h b/lib/CGameInfoCallback.h index 2d2065cfc..31aafdde5 100644 --- a/lib/CGameInfoCallback.h +++ b/lib/CGameInfoCallback.h @@ -185,7 +185,7 @@ public: //objects const CGObjectInstance * getObj(ObjectInstanceID objid, bool verbose = true) const override; virtual std::vector getBlockingObjs(int3 pos)const; - virtual std::vector getVisitableObjs(int3 pos, bool verbose = true) const override; + std::vector getVisitableObjs(int3 pos, bool verbose = true) const override; virtual std::vector getFlaggableObjects(int3 pos) const; virtual const CGObjectInstance * getTopObj (int3 pos) const; virtual PlayerColor getOwner(ObjectInstanceID heroID) const; diff --git a/lib/CGameInterface.h b/lib/CGameInterface.h index c3d286455..2bfc0bc9a 100644 --- a/lib/CGameInterface.h +++ b/lib/CGameInterface.h @@ -150,17 +150,17 @@ public: void battleNewRound(const BattleID & battleID) override; void battleCatapultAttacked(const BattleID & battleID, const CatapultAttack & ca) override; void battleStart(const BattleID & battleID, const CCreatureSet *army1, const CCreatureSet *army2, int3 tile, const CGHeroInstance *hero1, const CGHeroInstance *hero2, bool side, bool replayAllowed) override; - virtual void battleStacksAttacked(const BattleID & battleID, const std::vector & bsa, bool ranged) override; + void battleStacksAttacked(const BattleID & battleID, const std::vector & bsa, bool ranged) override; void actionStarted(const BattleID & battleID, const BattleAction &action) override; void battleNewRoundFirst(const BattleID & battleID) override; void actionFinished(const BattleID & battleID, const BattleAction &action) override; void battleStacksEffectsSet(const BattleID & battleID, const SetStackEffect & sse) override; - virtual void battleObstaclesChanged(const BattleID & battleID, const std::vector & obstacles) override; - virtual void battleStackMoved(const BattleID & battleID, const CStack * stack, std::vector dest, int distance, bool teleport) override; + void battleObstaclesChanged(const BattleID & battleID, const std::vector & obstacles) override; + void battleStackMoved(const BattleID & battleID, const CStack * stack, std::vector dest, int distance, bool teleport) override; void battleAttack(const BattleID & battleID, const BattleAttack *ba) override; void battleSpellCast(const BattleID & battleID, const BattleSpellCast *sc) override; void battleEnd(const BattleID & battleID, const BattleResult *br, QueryID queryID) override; - virtual void battleUnitsChanged(const BattleID & battleID, const std::vector & units) override; + void battleUnitsChanged(const BattleID & battleID, const std::vector & units) override; void saveGame(BinarySerializer & h) override; void loadGame(BinaryDeserializer & h) override; diff --git a/lib/RiverHandler.h b/lib/RiverHandler.h index c070a53a8..c13736e76 100644 --- a/lib/RiverHandler.h +++ b/lib/RiverHandler.h @@ -69,8 +69,8 @@ public: RiverTypeHandler(); - virtual const std::vector & getTypeNames() const override; - virtual std::vector loadLegacyData() override; + const std::vector & getTypeNames() const override; + std::vector loadLegacyData() override; }; VCMI_LIB_NAMESPACE_END diff --git a/lib/RoadHandler.h b/lib/RoadHandler.h index f58d5b9bb..5f31d1858 100644 --- a/lib/RoadHandler.h +++ b/lib/RoadHandler.h @@ -59,8 +59,8 @@ public: RoadTypeHandler(); - virtual const std::vector & getTypeNames() const override; - virtual std::vector loadLegacyData() override; + const std::vector & getTypeNames() const override; + std::vector loadLegacyData() override; }; VCMI_LIB_NAMESPACE_END diff --git a/lib/TerrainHandler.h b/lib/TerrainHandler.h index 8b0f68fed..59c6ab62b 100644 --- a/lib/TerrainHandler.h +++ b/lib/TerrainHandler.h @@ -107,8 +107,8 @@ public: const std::string & identifier, size_t index) override; - virtual const std::vector & getTypeNames() const override; - virtual std::vector loadLegacyData() override; + const std::vector & getTypeNames() const override; + std::vector loadLegacyData() override; }; VCMI_LIB_NAMESPACE_END diff --git a/lib/bonuses/Updaters.h b/lib/bonuses/Updaters.h index f96c552e9..8e3a7ed49 100644 --- a/lib/bonuses/Updaters.h +++ b/lib/bonuses/Updaters.h @@ -48,7 +48,7 @@ public: } std::shared_ptr createUpdatedBonus(const std::shared_ptr & b, const CBonusSystemNode & context) const override; - virtual std::string toString() const override; + std::string toString() const override; JsonNode toJsonNode() const override; }; @@ -61,7 +61,7 @@ public: } std::shared_ptr createUpdatedBonus(const std::shared_ptr & b, const CBonusSystemNode & context) const override; - virtual std::string toString() const override; + std::string toString() const override; JsonNode toJsonNode() const override; }; @@ -74,7 +74,7 @@ public: } std::shared_ptr createUpdatedBonus(const std::shared_ptr & b, const CBonusSystemNode & context) const override; - virtual std::string toString() const override; + std::string toString() const override; JsonNode toJsonNode() const override; }; @@ -97,7 +97,7 @@ public: } std::shared_ptr createUpdatedBonus(const std::shared_ptr & b, const CBonusSystemNode & context) const override; - virtual std::string toString() const override; + std::string toString() const override; JsonNode toJsonNode() const override; }; @@ -110,7 +110,7 @@ public: } std::shared_ptr createUpdatedBonus(const std::shared_ptr& b, const CBonusSystemNode& context) const override; - virtual std::string toString() const override; + std::string toString() const override; JsonNode toJsonNode() const override; }; diff --git a/lib/pathfinder/NodeStorage.h b/lib/pathfinder/NodeStorage.h index afe19b10e..e8a70a63b 100644 --- a/lib/pathfinder/NodeStorage.h +++ b/lib/pathfinder/NodeStorage.h @@ -34,7 +34,7 @@ public: void initialize(const PathfinderOptions & options, const CGameState * gs) override; virtual ~NodeStorage() = default; - virtual std::vector getInitialNodes() override; + std::vector getInitialNodes() override; virtual std::vector calculateNeighbours( const PathNodeInfo & source, diff --git a/lib/rmg/CRmgTemplateStorage.h b/lib/rmg/CRmgTemplateStorage.h index 4470c51d8..65b0c0f09 100644 --- a/lib/rmg/CRmgTemplateStorage.h +++ b/lib/rmg/CRmgTemplateStorage.h @@ -27,8 +27,8 @@ public: std::vector loadLegacyData() override; /// loads single object into game. Scope is namespace of this object, same as name of source mod - virtual void loadObject(std::string scope, std::string name, const JsonNode & data) override; - virtual void loadObject(std::string scope, std::string name, const JsonNode & data, size_t index) override; + void loadObject(std::string scope, std::string name, const JsonNode & data) override; + void loadObject(std::string scope, std::string name, const JsonNode & data, size_t index) override; void afterLoadFinalization() override; From c65794b9e355bc65103245be4fea2cd39db10afc Mon Sep 17 00:00:00 2001 From: Alexander Wilms Date: Tue, 13 Feb 2024 15:23:30 +0100 Subject: [PATCH 2/2] Fix typos --- client/gui/CIntObject.h | 2 +- config/filesystem.json | 2 +- docs/modders/Difficulty.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/gui/CIntObject.h b/client/gui/CIntObject.h index 7909e72e7..71bda7911 100644 --- a/client/gui/CIntObject.h +++ b/client/gui/CIntObject.h @@ -108,7 +108,7 @@ public: bool isPopupWindow() const override; /// called only for windows whenever screen size changes - /// default behavior is to re-center, can be overriden + /// default behavior is to re-center, can be overridden void onScreenResize() override; /// returns true if UI elements wants to handle event of specific type (LCLICK, SHOW_POPUP ...) diff --git a/config/filesystem.json b/config/filesystem.json index 0a388c31b..e57599a78 100644 --- a/config/filesystem.json +++ b/config/filesystem.json @@ -28,7 +28,7 @@ {"type" : "snd", "path" : "Data/H3ab_ahd.snd"}, {"type" : "snd", "path" : "Data/Heroes3.snd"}, {"type" : "snd", "path" : "Data/Heroes3-cd2.snd"}, - //WoG have overriden sounds with .82m extension in Data + //WoG have overridden sounds with .82m extension in Data {"type" : "dir", "path" : "Data", "depth": 0} ], "MUSIC/": diff --git a/docs/modders/Difficulty.md b/docs/modders/Difficulty.md index 75c44d768..190df9aa8 100644 --- a/docs/modders/Difficulty.md +++ b/docs/modders/Difficulty.md @@ -4,7 +4,7 @@ Since VCMI 1.4.0 there are more capabilities to configure difficulty parameters. It means, that modders can give different bonuses to AI or human players depending on selected difficulty -Difficulty configuration is located in [config/difficulty.json](../config/difficulty.json) file and can be overriden by mods. +Difficulty configuration is located in [config/difficulty.json](../config/difficulty.json) file and can be overridden by mods. ## Format summary