mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-29 23:07:48 +02:00
c++03 -> c++11 switch:
- use std versions of function, bind and ref - OVERRIDE -> override - NULL -> nullptr - use std versions of random distributions NOTE: this may be last revision that supports gcc-4.5
This commit is contained in:
@@ -100,7 +100,7 @@ TerrainTile::TerrainTile() : terType(ETerrainType::BORDER), terView(0), riverTyp
|
||||
|
||||
}
|
||||
|
||||
bool TerrainTile::entrableTerrain(const TerrainTile * from /*= NULL*/) const
|
||||
bool TerrainTile::entrableTerrain(const TerrainTile * from /*= nullptr*/) const
|
||||
{
|
||||
return entrableTerrain(from ? from->terType != ETerrainType::WATER : true, from ? from->terType == ETerrainType::WATER : true);
|
||||
}
|
||||
@@ -111,7 +111,7 @@ bool TerrainTile::entrableTerrain(bool allowLand, bool allowSea) const
|
||||
&& ((allowSea && terType == ETerrainType::WATER) || (allowLand && terType != ETerrainType::WATER));
|
||||
}
|
||||
|
||||
bool TerrainTile::isClear(const TerrainTile *from /*= NULL*/) const
|
||||
bool TerrainTile::isClear(const TerrainTile *from /*= nullptr*/) const
|
||||
{
|
||||
return entrableTerrain(from) && !blocked;
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ struct DLL_LINKAGE VictoryCondition
|
||||
si32 objectId;
|
||||
/// needed count for creatures (1) / resource (2); upgraded town hall level (3);
|
||||
si32 count;
|
||||
/// object of specific monster / city / hero instance (NULL if not used); set during map parsing
|
||||
/// object of specific monster / city / hero instance (nullptr if not used); set during map parsing
|
||||
const CGObjectInstance * obj;
|
||||
|
||||
template <typename Handler>
|
||||
@@ -240,10 +240,10 @@ 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 = NULL) const;
|
||||
bool entrableTerrain(const TerrainTile * from = nullptr) const;
|
||||
bool entrableTerrain(bool allowLand, bool allowSea) const;
|
||||
/// Checks for blocking objects and terraint type (water / land).
|
||||
bool isClear(const TerrainTile * from = NULL) const;
|
||||
bool isClear(const TerrainTile * from = nullptr) const;
|
||||
/// Gets the ID of the top visitable object or -1 if there is none.
|
||||
int topVisitableId() const;
|
||||
bool isWater() const;
|
||||
|
||||
Reference in New Issue
Block a user