diff --git a/client/CMusicHandler.h b/client/CMusicHandler.h index 401185b5f..fa69d8a28 100644 --- a/client/CMusicHandler.h +++ b/client/CMusicHandler.h @@ -84,7 +84,7 @@ public: // Sets std::vector pickupSounds; std::vector battleIntroSounds; - std::map horseSounds; + std::map horseSounds; }; // Helper //now it looks somewhat useless diff --git a/client/CPlayerInterface.cpp b/client/CPlayerInterface.cpp index 7cf8463d3..2b6bea79b 100644 --- a/client/CPlayerInterface.cpp +++ b/client/CPlayerInterface.cpp @@ -2746,8 +2746,8 @@ void CPlayerInterface::doMoveHero(const CGHeroInstance * h, CGPath path) { path.convert(0); - TTerrainId currentTerrain = Terrain::BORDER; // not init yet - TTerrainId newTerrain; + TerrainId currentTerrain = Terrain::BORDER; // not init yet + TerrainId newTerrain; int sh = -1; auto canStop = [&](CGPathNode * node) -> bool diff --git a/client/widgets/AdventureMapClasses.cpp b/client/widgets/AdventureMapClasses.cpp index 4f9697cb3..23c2f03d1 100644 --- a/client/widgets/AdventureMapClasses.cpp +++ b/client/widgets/AdventureMapClasses.cpp @@ -495,9 +495,9 @@ void CMinimapInstance::showAll(SDL_Surface * to) } } -std::map > CMinimap::loadColors() +std::map > CMinimap::loadColors() { - std::map > ret; + std::map > ret; for(const auto & terrain : CGI->terrainTypeHandler->terrains()) { diff --git a/client/widgets/AdventureMapClasses.h b/client/widgets/AdventureMapClasses.h index a1b3c4242..9eb592c3c 100644 --- a/client/widgets/AdventureMapClasses.h +++ b/client/widgets/AdventureMapClasses.h @@ -222,7 +222,7 @@ protected: int level; //to initialize colors - std::map > loadColors(); + std::map > loadColors(); void clickLeft(tribool down, bool previousState) override; void clickRight(tribool down, bool previousState) override; @@ -233,7 +233,7 @@ protected: public: // terrainID -> (normal color, blocked color) - const std::map > colors; + const std::map > colors; CMinimap(const Rect & position); diff --git a/lib/CCreatureHandler.cpp b/lib/CCreatureHandler.cpp index 1cf20badc..a2ff1389d 100644 --- a/lib/CCreatureHandler.cpp +++ b/lib/CCreatureHandler.cpp @@ -285,13 +285,13 @@ std::string CCreature::nodeName() const return "\"" + namePl + "\""; } -bool CCreature::isItNativeTerrain(TTerrainId terrain) const +bool CCreature::isItNativeTerrain(TerrainId terrain) const { auto native = getNativeTerrain(); return native == terrain || native == Terrain::ANY_TERRAIN; } -TTerrainId CCreature::getNativeTerrain() const +TerrainId CCreature::getNativeTerrain() const { const std::string cachingStringNoTerrainPenalty = "type_NO_TERRAIN_PENALTY"; static const auto selectorNoTerrainPenalty = Selector::type()(Bonus::NO_TERRAIN_PENALTY); diff --git a/lib/CCreatureHandler.h b/lib/CCreatureHandler.h index a49df00b1..edf730767 100644 --- a/lib/CCreatureHandler.h +++ b/lib/CCreatureHandler.h @@ -121,14 +121,14 @@ public: ArtifactID warMachine; - bool isItNativeTerrain(TTerrainId terrain) const; + bool isItNativeTerrain(TerrainId terrain) const; /** Returns creature native terrain considering some terrain bonuses. @param considerBonus is used to avoid Dead Lock when this method is called inside getAllBonuses considerBonus = true is called from Pathfinder and fills actual nativeTerrain considering bonus(es). considerBonus = false is called on Battle init and returns already prepared nativeTerrain without Bonus system calling. */ - TTerrainId getNativeTerrain() const; + TerrainId getNativeTerrain() const; int32_t getIndex() const override; int32_t getIconIndex() const override; const std::string & getName() const override; diff --git a/lib/CGeneralTextHandler.h b/lib/CGeneralTextHandler.h index 606ad929d..bc5dcc07b 100644 --- a/lib/CGeneralTextHandler.h +++ b/lib/CGeneralTextHandler.h @@ -124,7 +124,7 @@ public: std::vector advobtxt; std::vector xtrainfo; std::vector restypes; //names of resources - std::map terrainNames; + std::map terrainNames; std::vector randsign; std::vector> mines; //first - name; second - event description std::vector seerEmpty; diff --git a/lib/CHeroHandler.h b/lib/CHeroHandler.h index 44113ce5d..023015705 100644 --- a/lib/CHeroHandler.h +++ b/lib/CHeroHandler.h @@ -266,7 +266,7 @@ public: CHeroClassHandler classes; //default costs of going through terrains. -1 means terrain is impassable - std::map terrCosts; + std::map terrCosts; struct SBallisticsLevelInfo { diff --git a/lib/CPathfinder.h b/lib/CPathfinder.h index 817d31a29..daa28c6b4 100644 --- a/lib/CPathfinder.h +++ b/lib/CPathfinder.h @@ -529,7 +529,7 @@ struct DLL_LINKAGE TurnInfo TConstBonusListPtr bonuses; mutable int maxMovePointsLand; mutable int maxMovePointsWater; - TTerrainId nativeTerrain; + TerrainId nativeTerrain; TurnInfo(const CGHeroInstance * Hero, const int Turn = 0); bool isLayerAvailable(const EPathfindingLayer layer) const; diff --git a/lib/CStack.cpp b/lib/CStack.cpp index 9d538dc68..6e9a50b4a 100644 --- a/lib/CStack.cpp +++ b/lib/CStack.cpp @@ -334,7 +334,7 @@ bool CStack::isOnNativeTerrain() const return res; } -bool CStack::isOnTerrain(TTerrainId terrain) const +bool CStack::isOnTerrain(TerrainId terrain) const { return battle->getTerrainType() == terrain; } diff --git a/lib/CStack.h b/lib/CStack.h index 574903697..fa31a3d03 100644 --- a/lib/CStack.h +++ b/lib/CStack.h @@ -31,7 +31,7 @@ public: ui32 ID; //unique ID of stack const CCreature * type; - TTerrainId nativeTerrain; //tmp variable to save native terrain value on battle init + TerrainId nativeTerrain; //tmp variable to save native terrain value on battle init ui32 baseAmount; PlayerColor owner; //owner - player color (255 for neutrals) @@ -53,7 +53,7 @@ public: bool canBeHealed() const; //for first aid tent - only harmed stacks that are not war machines bool isOnNativeTerrain() const; - bool isOnTerrain(TTerrainId terrain) const; + bool isOnTerrain(TerrainId terrain) const; ui32 level() const; si32 magicResistance() const override; //include aura of resistance diff --git a/lib/CTownHandler.cpp b/lib/CTownHandler.cpp index 571c067f7..c50d097d4 100644 --- a/lib/CTownHandler.cpp +++ b/lib/CTownHandler.cpp @@ -28,9 +28,9 @@ VCMI_LIB_NAMESPACE_BEGIN const int NAMES_PER_TOWN=16; // number of town names per faction in H3 files. Json can define any number -const TTerrainId CTownHandler::defaultGoodTerrain(Terrain::GRASS); -const TTerrainId CTownHandler::defaultEvilTerrain(Terrain::LAVA); -const TTerrainId CTownHandler::defaultNeutralTerrain(Terrain::ROUGH); +const TerrainId CTownHandler::defaultGoodTerrain(Terrain::GRASS); +const TerrainId CTownHandler::defaultEvilTerrain(Terrain::LAVA); +const TerrainId CTownHandler::defaultNeutralTerrain(Terrain::ROUGH); const std::map CBuilding::MODES = { @@ -944,9 +944,9 @@ void CTownHandler::loadPuzzle(CFaction &faction, const JsonNode &source) assert(faction.puzzleMap.size() == GameConstants::PUZZLE_MAP_PIECES); } -TTerrainId CTownHandler::getDefaultTerrainForAlignment(EAlignment::EAlignment alignment) const +TerrainId CTownHandler::getDefaultTerrainForAlignment(EAlignment::EAlignment alignment) const { - TTerrainId terrain = defaultGoodTerrain; + TerrainId terrain = defaultGoodTerrain; switch(alignment) { diff --git a/lib/CTownHandler.h b/lib/CTownHandler.h index d87afd7a0..0128b44b3 100644 --- a/lib/CTownHandler.h +++ b/lib/CTownHandler.h @@ -187,7 +187,7 @@ public: TFaction index; - TTerrainId nativeTerrain; + TerrainId nativeTerrain; EAlignment::EAlignment alignment; bool preferUndergroundPlacement; @@ -360,9 +360,9 @@ class DLL_LINKAGE CTownHandler : public CHandlerBase requirementsToLoad; std::vector overriddenBidsToLoad; //list of buildings, which bonuses should be overridden. - const static TTerrainId defaultGoodTerrain; - const static TTerrainId defaultEvilTerrain; - const static TTerrainId defaultNeutralTerrain; + const static TerrainId defaultGoodTerrain; + const static TerrainId defaultEvilTerrain; + const static TerrainId defaultNeutralTerrain; static TPropagatorPtr & emptyPropagator(); @@ -393,7 +393,7 @@ class DLL_LINKAGE CTownHandler : public CHandlerBase TDmgRange; typedef si32 TBonusSubtype; typedef si32 TQuantity; -typedef si8 TTerrainId; -typedef si8 TRoadId; -typedef si8 TRiverId; +typedef si8 TerrainId; +typedef si8 RoadId; +typedef si8 RiverId; typedef int TRmgTemplateZoneId; diff --git a/lib/HeroBonus.cpp b/lib/HeroBonus.cpp index daf11989d..b43346658 100644 --- a/lib/HeroBonus.cpp +++ b/lib/HeroBonus.cpp @@ -2113,7 +2113,7 @@ CreatureTerrainLimiter::CreatureTerrainLimiter() { } -CreatureTerrainLimiter::CreatureTerrainLimiter(TTerrainId terrain): +CreatureTerrainLimiter::CreatureTerrainLimiter(TerrainId terrain): terrainType(terrain) { } diff --git a/lib/HeroBonus.h b/lib/HeroBonus.h index 9901657e5..482671e5f 100644 --- a/lib/HeroBonus.h +++ b/lib/HeroBonus.h @@ -1062,9 +1062,9 @@ public: class DLL_LINKAGE CreatureTerrainLimiter : public ILimiter //applies only to creatures that are on specified terrain, default native terrain { public: - TTerrainId terrainType; + TerrainId terrainType; CreatureTerrainLimiter(); - CreatureTerrainLimiter(TTerrainId terrain); + CreatureTerrainLimiter(TerrainId terrain); int limit(const BonusLimitationContext &context) const override; virtual std::string toString() const override; diff --git a/lib/NetPacksLib.cpp b/lib/NetPacksLib.cpp index a6c57d1fd..ea70103b8 100644 --- a/lib/NetPacksLib.cpp +++ b/lib/NetPacksLib.cpp @@ -703,7 +703,7 @@ DLL_LINKAGE void GiveHero::applyGs(CGameState *gs) DLL_LINKAGE void NewObject::applyGs(CGameState *gs) { - TTerrainId terrainType = Terrain::BORDER; + TerrainId terrainType = Terrain::BORDER; if(ID == Obj::BOAT && !gs->isInTheMap(pos)) //special handling for bug #3060 - pos outside map but visitablePos is not { diff --git a/lib/ObstacleHandler.cpp b/lib/ObstacleHandler.cpp index 5e5f22536..37019cb2a 100644 --- a/lib/ObstacleHandler.cpp +++ b/lib/ObstacleHandler.cpp @@ -68,7 +68,7 @@ std::vector ObstacleInfo::getBlocked(BattleHex hex) const return ret; } -bool ObstacleInfo::isAppropriate(const TTerrainId terrainType, const BattleField & battlefield) const +bool ObstacleInfo::isAppropriate(const TerrainId terrainType, const BattleField & battlefield) const { auto bgInfo = battlefield.getInfo(); diff --git a/lib/ObstacleHandler.h b/lib/ObstacleHandler.h index 0aa0e5c6c..f79ff6877 100644 --- a/lib/ObstacleHandler.h +++ b/lib/ObstacleHandler.h @@ -33,7 +33,7 @@ public: si32 iconIndex; std::string identifier; std::string appearAnimation, animation, dissapearAnimation; - std::vector allowedTerrains; + std::vector allowedTerrains; std::vector allowedSpecialBfields; //TODO: here is extra field to implement it's logic in the future but save backward compatibility @@ -52,7 +52,7 @@ public: std::vector getBlocked(BattleHex hex) const; //returns vector of hexes blocked by obstacle when it's placed on hex 'hex' - bool isAppropriate(const TTerrainId terrainType, const BattleField & specialBattlefield) const; + bool isAppropriate(const TerrainId terrainType, const BattleField & specialBattlefield) const; template void serialize(Handler &h, const int version) { diff --git a/lib/Terrain.cpp b/lib/Terrain.cpp index cbf67eda5..b6f399d12 100644 --- a/lib/Terrain.cpp +++ b/lib/Terrain.cpp @@ -149,16 +149,16 @@ void TerrainTypeHandler::initTerrains(const std::vector & allConfig if(!terr.second["originalTerrainId"].isNull()) { //place in reserved slot - info.id = (TTerrainId)(terr.second["originalTerrainId"].Float()); + info.id = (TerrainId)(terr.second["originalTerrainId"].Float()); objects[info.id] = info; } else { //append at the end - info.id = static_cast(objects.size()); + info.id = static_cast(objects.size()); objects.push_back(info); } - TTerrainId id = info.id; + TerrainId id = info.id; //Update terrain with this id in the future, after all terrain types are populated @@ -226,12 +226,12 @@ void TerrainTypeHandler::initRivers(const std::vector & allConfigs) if (!river.second["originalRiverId"].isNull()) { - info.id = static_cast(river.second["originalRiverId"].Float()); + info.id = static_cast(river.second["originalRiverId"].Float()); riverTypes[info.id] = info; } else { - info.id = static_cast(riverTypes.size()); + info.id = static_cast(riverTypes.size()); riverTypes.push_back(info); } } @@ -261,12 +261,12 @@ void TerrainTypeHandler::initRoads(const std::vector & allConfigs) if (!road.second["originalRoadId"].isNull()) { - info.id = static_cast(road.second["originalRoadId"].Float()); + info.id = static_cast(road.second["originalRoadId"].Float()); roadTypes[info.id] = info; } else { - info.id = static_cast(roadTypes.size()); + info.id = static_cast(roadTypes.size()); roadTypes.push_back(info); } } @@ -339,7 +339,7 @@ const TerrainType* TerrainTypeHandler::getInfoByCode(const std::string& terrainC return terrainInfoByCode.at(terrainCode); } -const TerrainType* TerrainTypeHandler::getInfoById(TTerrainId id) const +const TerrainType* TerrainTypeHandler::getInfoById(TerrainId id) const { return terrainInfoById.at(id); } @@ -354,7 +354,7 @@ const RiverType* TerrainTypeHandler::getRiverByCode(const std::string& riverCode return riverInfoByCode.at(riverCode); } -const RiverType* TerrainTypeHandler::getRiverById(TRiverId id) const +const RiverType* TerrainTypeHandler::getRiverById(RiverId id) const { return riverInfoById.at(id); } @@ -369,7 +369,7 @@ const RoadType* TerrainTypeHandler::getRoadByCode(const std::string& roadCode) c return roadInfoByCode.at(roadCode); } -const RoadType* TerrainTypeHandler::getRoadById(TRoadId id) const +const RoadType* TerrainTypeHandler::getRoadById(RoadId id) const { return roadInfoById.at(id); } @@ -467,7 +467,7 @@ bool TerrainType::isTransitionRequired() const return transitionRequired; } -RiverType::RiverType(const std::string & fileName, const std::string & code, TRiverId id): +RiverType::RiverType(const std::string & fileName, const std::string & code, RiverId id): fileName(fileName), code(code), id(id) @@ -484,7 +484,7 @@ RiverType& RiverType::operator=(const RiverType& other) return *this; } -RoadType::RoadType(const std::string& fileName, const std::string& code, TRoadId id): +RoadType::RoadType(const std::string& fileName, const std::string& code, RoadId id): fileName(fileName), code(code), id(id), diff --git a/lib/Terrain.h b/lib/Terrain.h index 0d0a9fdf4..a4aae7b8a 100644 --- a/lib/Terrain.h +++ b/lib/Terrain.h @@ -30,7 +30,7 @@ public: }; std::vector battleFields; - std::vector prohibitTransitions; + std::vector prohibitTransitions; std::array minimapBlocked; std::array minimapUnblocked; std::string name; @@ -39,10 +39,10 @@ public: std::string terrainText; std::string typeCode; std::string terrainViewPatterns; - TRiverId river; + RiverId river; - TTerrainId id; - TTerrainId rockTerrain; + TerrainId id; + TerrainId rockTerrain; int moveCost; int horseSoundId; ui8 passabilityType; @@ -95,9 +95,9 @@ public: std::string fileName; std::string code; std::string deltaName; - TRiverId id; + RiverId id; - RiverType(const std::string & fileName = "", const std::string & code = "", TRiverId id = River::NO_RIVER); + RiverType(const std::string & fileName = "", const std::string & code = "", RiverId id = River::NO_RIVER); RiverType& operator=(const RiverType & other); @@ -115,10 +115,10 @@ class DLL_LINKAGE RoadType public: std::string fileName; std::string code; - TRoadId id; + RoadId id; ui8 movementCost; - RoadType(const std::string & fileName = "", const std::string& code = "", TRoadId id = Road::NO_ROAD); + RoadType(const std::string & fileName = "", const std::string& code = "", RoadId id = Road::NO_ROAD); RoadType& operator=(const RoadType & other); @@ -143,17 +143,17 @@ public: const std::vector & terrains() const; const TerrainType * getInfoByName(const std::string & terrainName) const; const TerrainType * getInfoByCode(const std::string & terrainCode) const; - const TerrainType * getInfoById(TTerrainId id) const; + const TerrainType * getInfoById(TerrainId id) const; const std::vector & rivers() const; const RiverType * getRiverByName(const std::string & riverName) const; const RiverType * getRiverByCode(const std::string & riverCode) const; - const RiverType * getRiverById(TRiverId id) const; + const RiverType * getRiverById(RiverId id) const; const std::vector & roads() const; const RoadType * getRoadByName(const std::string & roadName) const; const RoadType * getRoadByCode(const std::string & roadCode) const; - const RoadType * getRoadById(TRoadId id) const; + const RoadType * getRoadById(RoadId id) const; template void serialize(Handler &h, const int version) { @@ -177,15 +177,15 @@ private: std::unordered_map terrainInfoByName; std::unordered_map terrainInfoByCode; - std::unordered_map terrainInfoById; + std::unordered_map terrainInfoById; std::unordered_map riverInfoByName; std::unordered_map riverInfoByCode; - std::unordered_map riverInfoById; + std::unordered_map riverInfoById; std::unordered_map roadInfoByName; std::unordered_map roadInfoByCode; - std::unordered_map roadInfoById; + std::unordered_map roadInfoById; void initTerrains(const std::vector & allConfigs); void initRivers(const std::vector & allConfigs); diff --git a/lib/battle/BattleInfo.cpp b/lib/battle/BattleInfo.cpp index 4d9edbabd..ea5e7e776 100644 --- a/lib/battle/BattleInfo.cpp +++ b/lib/battle/BattleInfo.cpp @@ -191,7 +191,7 @@ struct RangeGenerator std::function myRand; }; -BattleInfo * BattleInfo::setupBattle(const int3 & tile, TTerrainId terrain, const BattleField & battlefieldType, const CArmedInstance * armies[2], const CGHeroInstance * heroes[2], bool creatureBank, const CGTownInstance * town) +BattleInfo * BattleInfo::setupBattle(const int3 & tile, TerrainId terrain, const BattleField & battlefieldType, const CArmedInstance * armies[2], const CGHeroInstance * heroes[2], bool creatureBank, const CGTownInstance * town) { CMP_stack cmpst; auto curB = new BattleInfo(); @@ -565,7 +565,7 @@ BattleField BattleInfo::getBattlefieldType() const return battlefieldType; } -TTerrainId BattleInfo::getTerrainType() const +TerrainId BattleInfo::getTerrainType() const { return terrainType; } diff --git a/lib/battle/BattleInfo.h b/lib/battle/BattleInfo.h index a5243dd06..76d3a9db2 100644 --- a/lib/battle/BattleInfo.h +++ b/lib/battle/BattleInfo.h @@ -39,7 +39,7 @@ public: SiegeInfo si; BattleField battlefieldType; //like !!BA:B - TTerrainId terrainType; //used for some stack nativity checks (not the bonus limiters though that have their own copy) + TerrainId terrainType; //used for some stack nativity checks (not the bonus limiters though that have their own copy) ui8 tacticsSide; //which side is requested to play tactics phase ui8 tacticDistance; //how many hexes we can go forward (1 = only hexes adjacent to margin line) @@ -75,7 +75,7 @@ public: battle::Units getUnitsIf(battle::UnitFilter predicate) const override; BattleField getBattlefieldType() const override; - TTerrainId getTerrainType() const override; + TerrainId getTerrainType() const override; ObstacleCList getAllObstacles() const override; @@ -140,7 +140,7 @@ public: const CGHeroInstance * getHero(PlayerColor player) const; //returns fighting hero that belongs to given player void localInit(); - static BattleInfo * setupBattle(const int3 & tile, TTerrainId, const BattleField & battlefieldType, const CArmedInstance * armies[2], const CGHeroInstance * heroes[2], bool creatureBank, const CGTownInstance * town); + static BattleInfo * setupBattle(const int3 & tile, TerrainId, const BattleField & battlefieldType, const CArmedInstance * armies[2], const CGHeroInstance * heroes[2], bool creatureBank, const CGTownInstance * town); ui8 whatSide(PlayerColor player) const; diff --git a/lib/battle/BattleProxy.cpp b/lib/battle/BattleProxy.cpp index 9b8646d3d..0ebb475ba 100644 --- a/lib/battle/BattleProxy.cpp +++ b/lib/battle/BattleProxy.cpp @@ -49,7 +49,7 @@ BattleField BattleProxy::getBattlefieldType() const return subject->battleGetBattlefieldType(); } -TTerrainId BattleProxy::getTerrainType() const +TerrainId BattleProxy::getTerrainType() const { return subject->battleTerrainType(); } diff --git a/lib/battle/BattleProxy.h b/lib/battle/BattleProxy.h index d95fbf440..8a7b0e13d 100644 --- a/lib/battle/BattleProxy.h +++ b/lib/battle/BattleProxy.h @@ -32,7 +32,7 @@ public: battle::Units getUnitsIf(battle::UnitFilter predicate) const override; BattleField getBattlefieldType() const override; - TTerrainId getTerrainType() const override; + TerrainId getTerrainType() const override; ObstacleCList getAllObstacles() const override; diff --git a/lib/battle/CBattleInfoEssentials.cpp b/lib/battle/CBattleInfoEssentials.cpp index b5a1b1d25..53fcd6dd8 100644 --- a/lib/battle/CBattleInfoEssentials.cpp +++ b/lib/battle/CBattleInfoEssentials.cpp @@ -16,9 +16,9 @@ VCMI_LIB_NAMESPACE_BEGIN -TTerrainId CBattleInfoEssentials::battleTerrainType() const +TerrainId CBattleInfoEssentials::battleTerrainType() const { - RETURN_IF_NOT_BATTLE(TTerrainId()); + RETURN_IF_NOT_BATTLE(TerrainId()); return getBattle()->getTerrainType(); } diff --git a/lib/battle/CBattleInfoEssentials.h b/lib/battle/CBattleInfoEssentials.h index e920adc2a..6903e66bc 100644 --- a/lib/battle/CBattleInfoEssentials.h +++ b/lib/battle/CBattleInfoEssentials.h @@ -48,7 +48,7 @@ public: BattlePerspective::BattlePerspective battleGetMySide() const; const IBonusBearer * getBattleNode() const; - TTerrainId battleTerrainType() const override; + TerrainId battleTerrainType() const override; BattleField battleGetBattlefieldType() const override; int32_t battleGetEnchanterCounter(ui8 side) const; diff --git a/lib/battle/IBattleInfoCallback.h b/lib/battle/IBattleInfoCallback.h index cb9e8b8d4..38e57f0dc 100644 --- a/lib/battle/IBattleInfoCallback.h +++ b/lib/battle/IBattleInfoCallback.h @@ -40,7 +40,7 @@ public: virtual scripting::Pool * getContextPool() const = 0; #endif - virtual TTerrainId battleTerrainType() const = 0; + virtual TerrainId battleTerrainType() const = 0; virtual BattleField battleGetBattlefieldType() const = 0; ///return none if battle is ongoing; otherwise the victorious side (0/1) or 2 if it is a draw diff --git a/lib/battle/IBattleState.h b/lib/battle/IBattleState.h index 7e60154ad..62536f4c1 100644 --- a/lib/battle/IBattleState.h +++ b/lib/battle/IBattleState.h @@ -44,7 +44,7 @@ public: virtual battle::Units getUnitsIf(battle::UnitFilter predicate) const = 0; virtual BattleField getBattlefieldType() const = 0; - virtual TTerrainId getTerrainType() const = 0; + virtual TerrainId getTerrainType() const = 0; virtual ObstacleCList getAllObstacles() const = 0; diff --git a/lib/mapObjects/CGHeroInstance.cpp b/lib/mapObjects/CGHeroInstance.cpp index fcb4457fb..49305863b 100644 --- a/lib/mapObjects/CGHeroInstance.cpp +++ b/lib/mapObjects/CGHeroInstance.cpp @@ -98,7 +98,7 @@ ui32 CGHeroInstance::getTileCost(const TerrainTile & dest, const TerrainTile & f return (ui32)ret; } -TTerrainId CGHeroInstance::getNativeTerrain() const +TerrainId CGHeroInstance::getNativeTerrain() const { // NOTE: in H3 neutral stacks will ignore terrain penalty only if placed as topmost stack(s) in hero army. // This is clearly bug in H3 however intended behaviour is not clear. @@ -106,11 +106,11 @@ TTerrainId CGHeroInstance::getNativeTerrain() const // will always have best penalty without any influence from player-defined stacks order // TODO: What should we do if all hero stacks are neutral creatures? - TTerrainId nativeTerrain = Terrain::BORDER; + TerrainId nativeTerrain = Terrain::BORDER; for(auto stack : stacks) { - TTerrainId stackNativeTerrain = stack.second->type->getNativeTerrain(); //consider terrain bonuses e.g. Lodestar. + TerrainId stackNativeTerrain = stack.second->type->getNativeTerrain(); //consider terrain bonuses e.g. Lodestar. if(stackNativeTerrain == Terrain::BORDER) //where does this value come from? continue; diff --git a/lib/mapObjects/CGHeroInstance.h b/lib/mapObjects/CGHeroInstance.h index 281d30eeb..7cd11583e 100644 --- a/lib/mapObjects/CGHeroInstance.h +++ b/lib/mapObjects/CGHeroInstance.h @@ -157,7 +157,7 @@ public: bool needsLastStack()const override; ui32 getTileCost(const TerrainTile &dest, const TerrainTile &from, const TurnInfo * ti) const; //move cost - applying pathfinding skill, road and terrain modifiers. NOT includes diagonal move penalty, last move levelling - TTerrainId getNativeTerrain() const; + TerrainId getNativeTerrain() const; ui32 getLowestCreatureSpeed() const; int3 getPosition(bool h3m = false) const; //h3m=true - returns position of hero object; h3m=false - returns position of hero 'manifestation' si32 manaRegain() const; //how many points of mana can hero regain "naturally" in one day diff --git a/lib/mapObjects/CObjectClassesHandler.cpp b/lib/mapObjects/CObjectClassesHandler.cpp index c90e1b8eb..bc0736774 100644 --- a/lib/mapObjects/CObjectClassesHandler.cpp +++ b/lib/mapObjects/CObjectClassesHandler.cpp @@ -590,7 +590,7 @@ BattleField AObjectTypeHandler::getBattlefield() const return battlefield ? BattleField::fromString(battlefield.get()) : BattleField::NONE; } -std::vector>AObjectTypeHandler::getTemplates(TTerrainId terrainType) const +std::vector>AObjectTypeHandler::getTemplates(TerrainId terrainType) const { std::vector> templates = getTemplates(); std::vector> filtered; @@ -607,7 +607,7 @@ std::vector>AObjectTypeHandler::getTemplat return filtered; } -std::shared_ptr AObjectTypeHandler::getOverride(TTerrainId terrainType, const CGObjectInstance * object) const +std::shared_ptr AObjectTypeHandler::getOverride(TerrainId terrainType, const CGObjectInstance * object) const { std::vector> ret = getTemplates(terrainType); for (const auto & tmpl: ret) diff --git a/lib/mapObjects/CObjectClassesHandler.h b/lib/mapObjects/CObjectClassesHandler.h index 0bc297380..224a95bb3 100644 --- a/lib/mapObjects/CObjectClassesHandler.h +++ b/lib/mapObjects/CObjectClassesHandler.h @@ -184,11 +184,11 @@ public: /// returns all templates matching parameters std::vector> getTemplates() const; - std::vector> getTemplates(const TTerrainId terrainType) const; + std::vector> getTemplates(const TerrainId terrainType) const; /// returns preferred template for this object, if present (e.g. one of 3 possible templates for town - village, fort and castle) /// note that appearance will not be changed - this must be done separately (either by assignment or via pack from server) - std::shared_ptr getOverride(TTerrainId terrainType, const CGObjectInstance * object) const; + std::shared_ptr getOverride(TerrainId terrainType, const CGObjectInstance * object) const; BattleField getBattlefield() const; diff --git a/lib/mapObjects/ObjectTemplate.cpp b/lib/mapObjects/ObjectTemplate.cpp index ef2fd91d3..a23b3db36 100644 --- a/lib/mapObjects/ObjectTemplate.cpp +++ b/lib/mapObjects/ObjectTemplate.cpp @@ -158,7 +158,7 @@ void ObjectTemplate::readTxt(CLegacyConfigParser & parser) std::string & terrStr = strings[4]; // allowed terrains, 1 = object can be placed on this terrain assert(terrStr.size() == Terrain::ROCK - 1); // all terrains but rock - for(TTerrainId i = Terrain::FIRST_REGULAR_TERRAIN; i < Terrain::ROCK; i++) + for(TerrainId i = Terrain::FIRST_REGULAR_TERRAIN; i < Terrain::ROCK; i++) { if (terrStr[8-i] == '1') allowedTerrains.insert(i); @@ -557,7 +557,7 @@ void ObjectTemplate::calculateVisitableOffset() visitableOffset = int3(0, 0, 0); } -bool ObjectTemplate::canBePlacedAt(TTerrainId terrain) const +bool ObjectTemplate::canBePlacedAt(TerrainId terrain) const { return vstd::contains(allowedTerrains, terrain); } diff --git a/lib/mapObjects/ObjectTemplate.h b/lib/mapObjects/ObjectTemplate.h index 2ac3825f6..b492d1770 100644 --- a/lib/mapObjects/ObjectTemplate.h +++ b/lib/mapObjects/ObjectTemplate.h @@ -33,7 +33,7 @@ class DLL_LINKAGE ObjectTemplate /// directions from which object can be entered, format same as for moveDir in CGHeroInstance(but 0 - 7) ui8 visitDir; /// list of terrains on which this object can be placed - std::set allowedTerrains; + std::set allowedTerrains; void afterLoadFixup(); @@ -100,7 +100,7 @@ public: }; // Checks if object can be placed on specific terrain - bool canBePlacedAt(TTerrainId terrain) const; + bool canBePlacedAt(TerrainId terrain) const; ObjectTemplate(); //custom copy constructor is required diff --git a/lib/mapping/CDrawRoadsOperation.cpp b/lib/mapping/CDrawRoadsOperation.cpp index 0c09e2d15..4c529b17f 100644 --- a/lib/mapping/CDrawRoadsOperation.cpp +++ b/lib/mapping/CDrawRoadsOperation.cpp @@ -158,14 +158,14 @@ CDrawLinesOperation::CDrawLinesOperation(CMap * map, const CTerrainSelection & t } ///CDrawRoadsOperation -CDrawRoadsOperation::CDrawRoadsOperation(CMap * map, const CTerrainSelection & terrainSel, TRoadId roadType, CRandomGenerator * gen): +CDrawRoadsOperation::CDrawRoadsOperation(CMap * map, const CTerrainSelection & terrainSel, RoadId roadType, CRandomGenerator * gen): CDrawLinesOperation(map, terrainSel,gen), roadType(roadType) { } ///CDrawRiversOperation -CDrawRiversOperation::CDrawRiversOperation(CMap * map, const CTerrainSelection & terrainSel, TRiverId riverType, CRandomGenerator * gen): +CDrawRiversOperation::CDrawRiversOperation(CMap * map, const CTerrainSelection & terrainSel, RiverId riverType, CRandomGenerator * gen): CDrawLinesOperation(map, terrainSel, gen), riverType(riverType) { diff --git a/lib/mapping/CDrawRoadsOperation.h b/lib/mapping/CDrawRoadsOperation.h index fb4e27af7..bb31868d0 100644 --- a/lib/mapping/CDrawRoadsOperation.h +++ b/lib/mapping/CDrawRoadsOperation.h @@ -63,7 +63,7 @@ protected: class CDrawRoadsOperation : public CDrawLinesOperation { public: - CDrawRoadsOperation(CMap * map, const CTerrainSelection & terrainSel, TRoadId roadType, CRandomGenerator * gen); + CDrawRoadsOperation(CMap * map, const CTerrainSelection & terrainSel, RoadId roadType, CRandomGenerator * gen); std::string getLabel() const override; protected: @@ -74,13 +74,13 @@ protected: void updateTile(TerrainTile & tile, const CDrawLinesOperation::LinePattern & pattern, const int flip) override; private: - TRoadId roadType; + RoadId roadType; }; class CDrawRiversOperation : public CDrawLinesOperation { public: - CDrawRiversOperation(CMap * map, const CTerrainSelection & terrainSel, TRoadId roadType, CRandomGenerator * gen); + CDrawRiversOperation(CMap * map, const CTerrainSelection & terrainSel, RoadId roadType, CRandomGenerator * gen); std::string getLabel() const override; protected: @@ -91,7 +91,7 @@ protected: void updateTile(TerrainTile & tile, const CDrawLinesOperation::LinePattern & pattern, const int flip) override; private: - TRiverId riverType; + RiverId riverType; }; VCMI_LIB_NAMESPACE_END diff --git a/lib/mapping/CMapEditManager.cpp b/lib/mapping/CMapEditManager.cpp index 814012c4b..1935ca6b8 100644 --- a/lib/mapping/CMapEditManager.cpp +++ b/lib/mapping/CMapEditManager.cpp @@ -126,19 +126,19 @@ void CMapEditManager::clearTerrain(CRandomGenerator * gen) execute(make_unique(map, gen ? gen : &(this->gen))); } -void CMapEditManager::drawTerrain(TTerrainId terType, CRandomGenerator * gen) +void CMapEditManager::drawTerrain(TerrainId terType, CRandomGenerator * gen) { execute(make_unique(map, terrainSel, terType, gen ? gen : &(this->gen))); terrainSel.clearSelection(); } -void CMapEditManager::drawRoad(TRoadId roadType, CRandomGenerator* gen) +void CMapEditManager::drawRoad(RoadId roadType, CRandomGenerator* gen) { execute(make_unique(map, terrainSel, roadType, gen ? gen : &(this->gen))); terrainSel.clearSelection(); } -void CMapEditManager::drawRiver(TRiverId riverType, CRandomGenerator* gen) +void CMapEditManager::drawRiver(RiverId riverType, CRandomGenerator* gen) { execute(make_unique(map, terrainSel, riverType, gen ? gen : &(this->gen))); terrainSel.clearSelection(); diff --git a/lib/mapping/CMapEditManager.h b/lib/mapping/CMapEditManager.h index 279a74217..c8dcbabbc 100644 --- a/lib/mapping/CMapEditManager.h +++ b/lib/mapping/CMapEditManager.h @@ -72,13 +72,13 @@ public: void clearTerrain(CRandomGenerator * gen = nullptr); /// Draws terrain at the current terrain selection. The selection will be cleared automatically. - void drawTerrain(TTerrainId terType, CRandomGenerator * gen = nullptr); + void drawTerrain(TerrainId terType, CRandomGenerator * gen = nullptr); /// Draws roads at the current terrain selection. The selection will be cleared automatically. - void drawRoad(TRoadId roadType, CRandomGenerator * gen = nullptr); + void drawRoad(RoadId roadType, CRandomGenerator * gen = nullptr); /// Draws rivers at the current terrain selection. The selection will be cleared automatically. - void drawRiver(TRiverId riverType, CRandomGenerator * gen = nullptr); + void drawRiver(RiverId riverType, CRandomGenerator * gen = nullptr); void insertObject(CGObjectInstance * obj); void insertObjects(std::set & objects); diff --git a/lib/mapping/CMapOperation.cpp b/lib/mapping/CMapOperation.cpp index 00682e236..b7a6872cb 100644 --- a/lib/mapping/CMapOperation.cpp +++ b/lib/mapping/CMapOperation.cpp @@ -83,7 +83,7 @@ void CComposedOperation::addOperation(std::unique_ptr&& operation operations.push_back(std::move(operation)); } -CDrawTerrainOperation::CDrawTerrainOperation(CMap* map, const CTerrainSelection& terrainSel, TTerrainId terType, CRandomGenerator* gen): +CDrawTerrainOperation::CDrawTerrainOperation(CMap* map, const CTerrainSelection& terrainSel, TerrainId terType, CRandomGenerator* gen): CMapOperation(map), terrainSel(terrainSel), terType(terType), diff --git a/lib/mapping/CMapOperation.h b/lib/mapping/CMapOperation.h index cc20afb65..96e110699 100644 --- a/lib/mapping/CMapOperation.h +++ b/lib/mapping/CMapOperation.h @@ -63,7 +63,7 @@ private: class CDrawTerrainOperation : public CMapOperation { public: - CDrawTerrainOperation(CMap * map, const CTerrainSelection & terrainSel, TTerrainId terType, CRandomGenerator * gen); + CDrawTerrainOperation(CMap * map, const CTerrainSelection & terrainSel, TerrainId terType, CRandomGenerator * gen); void execute() override; void undo() override; @@ -100,7 +100,7 @@ private: ValidationResult validateTerrainViewInner(const int3 & pos, const TerrainViewPattern & pattern, int recDepth = 0) const; CTerrainSelection terrainSel; - TTerrainId terType; + TerrainId terType; CRandomGenerator* gen; std::set invalidatedTerViews; }; diff --git a/lib/mapping/MapEditUtils.cpp b/lib/mapping/MapEditUtils.cpp index 849659094..b0e9dc822 100644 --- a/lib/mapping/MapEditUtils.cpp +++ b/lib/mapping/MapEditUtils.cpp @@ -270,7 +270,7 @@ CTerrainViewPatternConfig::~CTerrainViewPatternConfig() } -const std::vector & CTerrainViewPatternConfig::getTerrainViewPatterns(TTerrainId terrain) const +const std::vector & CTerrainViewPatternConfig::getTerrainViewPatterns(TerrainId terrain) const { auto iter = terrainViewPatterns.find(VLC->terrainTypeHandler->terrains()[terrain].terrainViewPatterns); if (iter == terrainViewPatterns.end()) @@ -295,7 +295,7 @@ boost::optional CTerrainViewPatternConfig::getTerrai return boost::optional(); } -boost::optional CTerrainViewPatternConfig::getTerrainViewPatternsById(TTerrainId terrain, const std::string & id) const +boost::optional CTerrainViewPatternConfig::getTerrainViewPatternsById(TerrainId terrain, const std::string & id) const { const std::vector & groupPatterns = getTerrainViewPatterns(terrain); for (const TVPVector & patternFlips : groupPatterns) diff --git a/lib/mapping/MapEditUtils.h b/lib/mapping/MapEditUtils.h index bdb3c1df6..288cc7b5a 100644 --- a/lib/mapping/MapEditUtils.h +++ b/lib/mapping/MapEditUtils.h @@ -217,9 +217,9 @@ public: CTerrainViewPatternConfig(); ~CTerrainViewPatternConfig(); - const std::vector & getTerrainViewPatterns(TTerrainId terrain) const; + const std::vector & getTerrainViewPatterns(TerrainId terrain) const; boost::optional getTerrainViewPatternById(std::string patternId, const std::string & id) const; - boost::optional getTerrainViewPatternsById(TTerrainId terrain, const std::string & id) const; + boost::optional getTerrainViewPatternsById(TerrainId terrain, const std::string & id) const; const TVPVector * getTerrainTypePatternById(const std::string & id) const; void flipPattern(TerrainViewPattern & pattern, int flip) const; diff --git a/lib/rmg/CRmgTemplate.cpp b/lib/rmg/CRmgTemplate.cpp index fae27e980..7e1051a5f 100644 --- a/lib/rmg/CRmgTemplate.cpp +++ b/lib/rmg/CRmgTemplate.cpp @@ -217,12 +217,12 @@ boost::optional ZoneOptions::getOwner() const return owner; } -const std::set & ZoneOptions::getTerrainTypes() const +const std::set & ZoneOptions::getTerrainTypes() const { return terrainTypes; } -void ZoneOptions::setTerrainTypes(const std::set & value) +void ZoneOptions::setTerrainTypes(const std::set & value) { //assert(value.find(ETerrainType::WRONG) == value.end() && value.find(ETerrainType::BORDER) == value.end() && // value.find(ETerrainType::WATER) == value.end() && value.find(ETerrainType::ROCK) == value.end()); diff --git a/lib/rmg/CRmgTemplate.h b/lib/rmg/CRmgTemplate.h index eaeb82f02..2b8ba45e3 100644 --- a/lib/rmg/CRmgTemplate.h +++ b/lib/rmg/CRmgTemplate.h @@ -105,8 +105,8 @@ public: void setSize(int value); boost::optional getOwner() const; - const std::set & getTerrainTypes() const; - void setTerrainTypes(const std::set & value); + const std::set & getTerrainTypes() const; + void setTerrainTypes(const std::set & value); const CTownInfo & getPlayerTowns() const; const CTownInfo & getNeutralTowns() const; @@ -146,7 +146,7 @@ protected: CTownInfo playerTowns; CTownInfo neutralTowns; bool matchTerrainToTown; - std::set terrainTypes; + std::set terrainTypes; bool townsAreSameType; std::set townTypes; diff --git a/lib/rmg/Functions.cpp b/lib/rmg/Functions.cpp index de90ee8c1..c73184bd9 100644 --- a/lib/rmg/Functions.cpp +++ b/lib/rmg/Functions.cpp @@ -95,14 +95,14 @@ void createBorder(RmgMap & gen, Zone & zone) } } -void paintZoneTerrain(const Zone & zone, CRandomGenerator & generator, RmgMap & map, TTerrainId terrain) +void paintZoneTerrain(const Zone & zone, CRandomGenerator & generator, RmgMap & map, TerrainId terrain) { auto v = zone.getArea().getTilesVector(); map.getEditManager()->getTerrainSelection().setSelection(v); map.getEditManager()->drawTerrain(terrain, &generator); } -int chooseRandomAppearance(CRandomGenerator & generator, si32 ObjID, TTerrainId terrain) +int chooseRandomAppearance(CRandomGenerator & generator, si32 ObjID, TerrainId terrain) { auto factories = VLC->objtypeh->knownSubObjects(ObjID); vstd::erase_if(factories, [ObjID, &terrain](si32 f) @@ -118,7 +118,7 @@ void initTerrainType(Zone & zone, CMapGenerator & gen) if(zone.getType()==ETemplateZoneType::WATER) { //collect all water terrain types - std::vector waterTerrains; + std::vector waterTerrains; for(const auto & terrain : VLC->terrainTypeHandler->terrains()) if(terrain.isWater()) waterTerrains.push_back(terrain.id); diff --git a/lib/rmg/Functions.h b/lib/rmg/Functions.h index fe9f35225..9e60506cf 100644 --- a/lib/rmg/Functions.h +++ b/lib/rmg/Functions.h @@ -42,11 +42,11 @@ rmg::Tileset collectDistantTiles(const Zone & zone, int distance); void createBorder(RmgMap & gen, Zone & zone); -void paintZoneTerrain(const Zone & zone, CRandomGenerator & generator, RmgMap & map, TTerrainId terrainType); +void paintZoneTerrain(const Zone & zone, CRandomGenerator & generator, RmgMap & map, TerrainId terrainType); void initTerrainType(Zone & zone, CMapGenerator & gen); -int chooseRandomAppearance(CRandomGenerator & generator, si32 ObjID, TTerrainId terrain); +int chooseRandomAppearance(CRandomGenerator & generator, si32 ObjID, TerrainId terrain); VCMI_LIB_NAMESPACE_END diff --git a/lib/rmg/ObstaclePlacer.cpp b/lib/rmg/ObstaclePlacer.cpp index adcad19d4..48eba161f 100644 --- a/lib/rmg/ObstaclePlacer.cpp +++ b/lib/rmg/ObstaclePlacer.cpp @@ -26,7 +26,7 @@ VCMI_LIB_NAMESPACE_BEGIN -void ObstacleProxy::collectPossibleObstacles(TTerrainId terrain) +void ObstacleProxy::collectPossibleObstacles(TerrainId terrain) { //get all possible obstacles for this terrain for(auto primaryID : VLC->objtypeh->knownObjects()) diff --git a/lib/rmg/ObstaclePlacer.h b/lib/rmg/ObstaclePlacer.h index beeabde74..b18a1bae0 100644 --- a/lib/rmg/ObstaclePlacer.h +++ b/lib/rmg/ObstaclePlacer.h @@ -26,7 +26,7 @@ public: rmg::Area blockedArea; - void collectPossibleObstacles(TTerrainId terrain); + void collectPossibleObstacles(TerrainId terrain); void placeObstacles(CMap * map, CRandomGenerator & rand); diff --git a/lib/rmg/RmgMap.cpp b/lib/rmg/RmgMap.cpp index 924e57638..c1aac566e 100644 --- a/lib/rmg/RmgMap.cpp +++ b/lib/rmg/RmgMap.cpp @@ -231,7 +231,7 @@ void RmgMap::setOccupied(const int3 &tile, ETileType::ETileType state) tiles[tile.x][tile.y][tile.z].setOccupied(state); } -void RmgMap::setRoad(const int3& tile, TRoadId roadType) +void RmgMap::setRoad(const int3& tile, RoadId roadType) { assertOnMap(tile); diff --git a/lib/rmg/RmgMap.h b/lib/rmg/RmgMap.h index 920e94449..16b160d54 100644 --- a/lib/rmg/RmgMap.h +++ b/lib/rmg/RmgMap.h @@ -46,7 +46,7 @@ public: bool isOnMap(const int3 & tile) const; void setOccupied(const int3 &tile, ETileType::ETileType state); - void setRoad(const int3 &tile, TRoadId roadType); + void setRoad(const int3 &tile, RoadId roadType); TileInfo getTile(const int3 & tile) const; diff --git a/lib/rmg/RmgObject.cpp b/lib/rmg/RmgObject.cpp index eb3bebc70..9758e94ad 100644 --- a/lib/rmg/RmgObject.cpp +++ b/lib/rmg/RmgObject.cpp @@ -105,7 +105,7 @@ void Object::Instance::setPositionRaw(const int3 & position) dObject.pos = dPosition + dParent.getPosition(); } -void Object::Instance::setTemplate(const TTerrainId & terrain) +void Object::Instance::setTemplate(const TerrainId & terrain) { if(dObject.appearance->id == Obj::NO_OBJ) { @@ -259,7 +259,7 @@ void Object::setPosition(const int3 & position) i.setPositionRaw(i.getPosition()); } -void Object::setTemplate(const TTerrainId & terrain) +void Object::setTemplate(const TerrainId & terrain) { for(auto& i : dInstances) i.setTemplate(terrain); diff --git a/lib/rmg/RmgObject.h b/lib/rmg/RmgObject.h index 36365cba2..627cd9599 100644 --- a/lib/rmg/RmgObject.h +++ b/lib/rmg/RmgObject.h @@ -35,7 +35,7 @@ public: int3 getVisitablePosition() const; bool isVisitableFrom(const int3 & tile) const; const Area & getAccessibleArea() const; - void setTemplate(const TTerrainId & terrain); //cache invalidation + void setTemplate(const TerrainId & terrain); //cache invalidation int3 getPosition(bool isAbsolute = false) const; void setPosition(const int3 & position); //cache invalidation @@ -71,7 +71,7 @@ public: const int3 & getPosition() const; void setPosition(const int3 & position); - void setTemplate(const TTerrainId & terrain); + void setTemplate(const TerrainId & terrain); const Area & getArea() const; //lazy cache invalidation diff --git a/lib/rmg/RoadPlacer.cpp b/lib/rmg/RoadPlacer.cpp index d58f59648..a435395af 100644 --- a/lib/rmg/RoadPlacer.cpp +++ b/lib/rmg/RoadPlacer.cpp @@ -72,7 +72,7 @@ void RoadPlacer::drawRoads(bool secondary) zone.freePaths().unite(roads); map.getEditManager()->getTerrainSelection().setSelection(roads.getTilesVector()); std::string roadCode = (secondary ? generator.getConfig().secondaryRoadType : generator.getConfig().defaultRoadType); - TRoadId roadType = VLC->terrainTypeHandler->getRoadByCode(roadCode)->id; + RoadId roadType = VLC->terrainTypeHandler->getRoadByCode(roadCode)->id; map.getEditManager()->drawRoad(roadType, &generator.rand); } diff --git a/lib/rmg/RockPlacer.h b/lib/rmg/RockPlacer.h index bd2b690e5..63789b1bf 100644 --- a/lib/rmg/RockPlacer.h +++ b/lib/rmg/RockPlacer.h @@ -28,7 +28,7 @@ public: protected: rmg::Area rockArea, accessibleArea; - TTerrainId rockTerrain; + TerrainId rockTerrain; }; VCMI_LIB_NAMESPACE_END diff --git a/lib/rmg/TileInfo.cpp b/lib/rmg/TileInfo.cpp index 3aad32ffd..4b37f2d99 100644 --- a/lib/rmg/TileInfo.cpp +++ b/lib/rmg/TileInfo.cpp @@ -63,17 +63,17 @@ ETileType::ETileType TileInfo::getTileType() const return occupied; } -TTerrainId TileInfo::getTerrainType() const +TerrainId TileInfo::getTerrainType() const { return terrain; } -void TileInfo::setTerrainType(TTerrainId type) +void TileInfo::setTerrainType(TerrainId type) { terrain = type; } -void TileInfo::setRoadType(TRoadId type) +void TileInfo::setRoadType(RoadId type) { roadType = type; // setOccupied(ETileType::FREE); diff --git a/lib/rmg/TileInfo.h b/lib/rmg/TileInfo.h index 0ac60d35d..951334b6d 100644 --- a/lib/rmg/TileInfo.h +++ b/lib/rmg/TileInfo.h @@ -30,16 +30,16 @@ public: bool isUsed() const; bool isRoad() const; void setOccupied(ETileType::ETileType value); - TTerrainId getTerrainType() const; + TerrainId getTerrainType() const; ETileType::ETileType getTileType() const; - void setTerrainType(TTerrainId value); + void setTerrainType(TerrainId value); - void setRoadType(TRoadId type); + void setRoadType(RoadId type); private: float nearestObjectDistance; ETileType::ETileType occupied; - TTerrainId terrain; - TRoadId roadType; + TerrainId terrain; + RoadId roadType; }; VCMI_LIB_NAMESPACE_END diff --git a/lib/rmg/TreasurePlacer.cpp b/lib/rmg/TreasurePlacer.cpp index 789d31eb7..0af06497c 100644 --- a/lib/rmg/TreasurePlacer.cpp +++ b/lib/rmg/TreasurePlacer.cpp @@ -813,7 +813,7 @@ ObjectInfo::ObjectInfo() } -void ObjectInfo::setTemplate(si32 type, si32 subtype, TTerrainId terrainType) +void ObjectInfo::setTemplate(si32 type, si32 subtype, TerrainId terrainType) { auto templHandler = VLC->objtypeh->getHandlerFor(type, subtype); if(!templHandler) diff --git a/lib/rmg/TreasurePlacer.h b/lib/rmg/TreasurePlacer.h index 63c77a0e4..eea60f255 100644 --- a/lib/rmg/TreasurePlacer.h +++ b/lib/rmg/TreasurePlacer.h @@ -28,7 +28,7 @@ struct ObjectInfo //ui32 maxPerMap; //unused std::function generateObject; - void setTemplate(si32 type, si32 subtype, TTerrainId terrain); + void setTemplate(si32 type, si32 subtype, TerrainId terrain); ObjectInfo(); diff --git a/lib/rmg/Zone.cpp b/lib/rmg/Zone.cpp index 6e59b56e5..fef80250f 100644 --- a/lib/rmg/Zone.cpp +++ b/lib/rmg/Zone.cpp @@ -134,12 +134,12 @@ void Zone::setTownType(si32 town) townType = town; } -TTerrainId Zone::getTerrainType() const +TerrainId Zone::getTerrainType() const { return terrainType; } -void Zone::setTerrainType(TTerrainId terrain) +void Zone::setTerrainType(TerrainId terrain) { terrainType = terrain; } diff --git a/lib/rmg/Zone.h b/lib/rmg/Zone.h index 01c152f21..d5d9521e2 100644 --- a/lib/rmg/Zone.h +++ b/lib/rmg/Zone.h @@ -100,8 +100,8 @@ public: si32 getTownType() const; void setTownType(si32 town); - TTerrainId getTerrainType() const; - void setTerrainType(TTerrainId terrain); + TerrainId getTerrainType() const; + void setTerrainType(TerrainId terrain); void connectPath(const rmg::Path & path); rmg::Path searchPath(const rmg::Area & src, bool onlyStraight, std::function areafilter = AREA_NO_FILTER) const; @@ -140,7 +140,7 @@ protected: //template info si32 townType; - TTerrainId terrainType; + TerrainId terrainType; }; diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index d37e6902e..73587ed1f 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -2241,7 +2241,7 @@ void CGameHandler::setupBattle(int3 tile, const CArmedInstance *armies[2], const battleResult.set(nullptr); const auto & t = *getTile(tile); - TTerrainId terrain = t.terType->id; + TerrainId terrain = t.terType->id; if (gs->map->isCoastalTile(tile)) //coastal tile is always ground terrain = Terrain::SAND; diff --git a/test/game/CGameStateTest.cpp b/test/game/CGameStateTest.cpp index cbda7d01e..67d7d49d8 100644 --- a/test/game/CGameStateTest.cpp +++ b/test/game/CGameStateTest.cpp @@ -193,7 +193,7 @@ public: const auto & t = *gameCallback->getTile(tile); - TTerrainId terrain = t.terType->id; + TerrainId terrain = t.terType->id; BattleField terType = BattleField::fromString("grass_hills"); //send info about battles diff --git a/test/mock/mock_IBattleInfoCallback.h b/test/mock/mock_IBattleInfoCallback.h index aa9183de7..b051f4355 100644 --- a/test/mock/mock_IBattleInfoCallback.h +++ b/test/mock/mock_IBattleInfoCallback.h @@ -17,7 +17,7 @@ class IBattleInfoCallbackMock : public IBattleInfoCallback { public: MOCK_CONST_METHOD0(getContextPool, scripting::Pool *()); - MOCK_CONST_METHOD0(battleTerrainType, TTerrainId()); + MOCK_CONST_METHOD0(battleTerrainType, TerrainId()); MOCK_CONST_METHOD0(battleGetBattlefieldType, BattleField()); MOCK_CONST_METHOD0(battleIsFinished, boost::optional()); diff --git a/test/mock/mock_battle_IBattleState.h b/test/mock/mock_battle_IBattleState.h index c63d2716f..779c12773 100644 --- a/test/mock/mock_battle_IBattleState.h +++ b/test/mock/mock_battle_IBattleState.h @@ -19,7 +19,7 @@ public: MOCK_CONST_METHOD1(getStacksIf, TStacks(TStackFilter)); MOCK_CONST_METHOD1(getUnitsIf, battle::Units(battle::UnitFilter)); MOCK_CONST_METHOD0(getBattlefieldType, BattleField()); - MOCK_CONST_METHOD0(getTerrainType, TTerrainId()); + MOCK_CONST_METHOD0(getTerrainType, TerrainId()); MOCK_CONST_METHOD0(getAllObstacles, IBattleInfo::ObstacleCList()); MOCK_CONST_METHOD0(getDefendedTown, const CGTownInstance *()); MOCK_CONST_METHOD1(getWallState, si8(int));