1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-12-24 00:36:29 +02:00

First version that compiles

This commit is contained in:
Tomasz Zieliński
2022-09-21 11:34:23 +02:00
parent b20f649521
commit 494b0f0226
93 changed files with 431 additions and 359 deletions

View File

@@ -123,8 +123,15 @@ CCastleEvent::CCastleEvent() : town(nullptr)
}
TerrainTile::TerrainTile() : terType("BORDER"), terView(0), riverType(RIVER_NAMES[0]),
riverDir(0), roadType(ROAD_NAMES[0]), roadDir(0), extTileFlags(0), visitable(false),
TerrainTile::TerrainTile():
terType(nullptr),
terView(0),
riverType(RIVER_NAMES[0]),
riverDir(0),
roadType(ROAD_NAMES[0]),
roadDir(0),
extTileFlags(0),
visitable(false),
blocked(false)
{
@@ -132,13 +139,13 @@ TerrainTile::TerrainTile() : terType("BORDER"), terView(0), riverType(RIVER_NAME
bool TerrainTile::entrableTerrain(const TerrainTile * from) const
{
return entrableTerrain(from ? from->terType.isLand() : true, from ? from->terType.isWater() : true);
return entrableTerrain(from ? from->terType->isLand() : true, from ? from->terType->isWater() : true);
}
bool TerrainTile::entrableTerrain(bool allowLand, bool allowSea) const
{
return terType.isPassable()
&& ((allowSea && terType.isWater()) || (allowLand && terType.isLand()));
return terType->isPassable()
&& ((allowSea && terType->isWater()) || (allowLand && terType->isLand()));
}
bool TerrainTile::isClear(const TerrainTile * from) const
@@ -164,7 +171,7 @@ CGObjectInstance * TerrainTile::topVisitableObj(bool excludeTop) const
EDiggingStatus TerrainTile::getDiggingStatus(const bool excludeTop) const
{
if(terType.isWater() || !terType.isPassable())
if(terType->isWater() || !terType->isPassable())
return EDiggingStatus::WRONG_TERRAIN;
int allowedBlocked = excludeTop ? 1 : 0;
@@ -181,7 +188,7 @@ bool TerrainTile::hasFavorableWinds() const
bool TerrainTile::isWater() const
{
return terType.isWater();
return terType->isWater();
}
void CMapHeader::setupEvents()