diff --git a/config/gameConfig.json b/config/gameConfig.json index e962291a4..92e869a0b 100644 --- a/config/gameConfig.json +++ b/config/gameConfig.json @@ -305,11 +305,11 @@ // if heroes are invitable in tavern "tavernInvite" : false, // minimal primary skills for heroes - "minimalPrimarySkills": [ 0, 0, 1, 1] + "minimalPrimarySkills": [ 0, 0, 1, 1], /// movement points hero can get on start of the turn when on land, depending on speed of slowest creature (0-based list) "movementPointsLand" : [ 1500, 1500, 1500, 1500, 1560, 1630, 1700, 1760, 1830, 1900, 1960, 2000 ], /// movement points hero can get on start of the turn when on sea, depending on speed of slowest creature (0-based list) - "movementPointsSea" : [ 1500 ], + "movementPointsSea" : [ 1500 ] }, "towns": diff --git a/lib/TerrainHandler.h b/lib/TerrainHandler.h index 201dde29a..2af6db3ca 100644 --- a/lib/TerrainHandler.h +++ b/lib/TerrainHandler.h @@ -83,14 +83,13 @@ public: TerrainType() = default; - bool isLand() const; - bool isWater() const; - bool isRock() const; + inline bool isLand() const; + inline bool isWater() const; + inline bool isRock() const; + inline bool isPassable() const; + inline bool isSurface() const; + inline bool isUnderground() const; - bool isPassable() const; - - bool isSurface() const; - bool isUnderground() const; bool isTransitionRequired() const; }; diff --git a/lib/mapping/CMap.h b/lib/mapping/CMap.h index 94d36b724..4fa4c2744 100644 --- a/lib/mapping/CMap.h +++ b/lib/mapping/CMap.h @@ -86,10 +86,10 @@ public: void initTerrain(); CMapEditManager * getEditManager(); - TerrainTile & getTile(const int3 & tile); - const TerrainTile & getTile(const int3 & tile) const; + inline TerrainTile & getTile(const int3 & tile); + inline const TerrainTile & getTile(const int3 & tile) const; bool isCoastalTile(const int3 & pos) const; - bool isInTheMap(const int3 & pos) const; + inline bool isInTheMap(const int3 & pos) const; bool canMoveBetween(const int3 &src, const int3 &dst) const; bool checkForVisitableDir(const int3 & src, const TerrainTile * pom, const int3 & dst) const; diff --git a/lib/mapping/CMapDefines.h b/lib/mapping/CMapDefines.h index 0317ac2b6..c34256506 100644 --- a/lib/mapping/CMapDefines.h +++ b/lib/mapping/CMapDefines.h @@ -104,31 +104,32 @@ struct DLL_LINKAGE TerrainTile TerrainTile(); /// Gets true if the terrain is not a rock. If from is water/land, same type is also required. - bool entrableTerrain(const TerrainTile * from = nullptr) const; - bool entrableTerrain(bool allowLand, bool allowSea) const; + inline bool entrableTerrain() const; + inline bool entrableTerrain(const TerrainTile * from) const; + inline bool entrableTerrain(bool allowLand, bool allowSea) const; /// Checks for blocking objects and terraint type (water / land). bool isClear(const TerrainTile * from = nullptr) const; /// Gets the ID of the top visitable object or -1 if there is none. Obj topVisitableId(bool excludeTop = false) const; CGObjectInstance * topVisitableObj(bool excludeTop = false) const; - bool isWater() const; - bool isLand() const; + inline bool isWater() const; + inline bool isLand() const; EDiggingStatus getDiggingStatus(bool excludeTop = true) const; - bool hasFavorableWinds() const; + inline bool hasFavorableWinds() const; - bool visitable() const; - bool blocked() const; + inline bool visitable() const; + inline bool blocked() const; - const TerrainType * getTerrain() const; - const RiverType * getRiver() const; - const RoadType * getRoad() const; + inline const TerrainType * getTerrain() const; + inline const RiverType * getRiver() const; + inline const RoadType * getRoad() const; - TerrainId getTerrainID() const; - RiverId getRiverID() const; - RoadId getRoadID() const; + inline TerrainId getTerrainID() const; + inline RiverId getRiverID() const; + inline RoadId getRoadID() const; - bool hasRiver() const; - bool hasRoad() const; + inline bool hasRiver() const; + inline bool hasRoad() const; TerrainId terrainType; RiverId riverType; @@ -259,6 +260,11 @@ inline RoadId TerrainTile::getRoadID() const return roadType; } +inline bool TerrainTile::entrableTerrain() const +{ + return entrableTerrain(true, true); +} + inline bool TerrainTile::entrableTerrain(const TerrainTile * from) const { const TerrainType * terrainFrom = from->getTerrain();