mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
Map/Road/River identifiers are now private members
This commit is contained in:
@@ -75,7 +75,7 @@ public:
|
||||
|
||||
static std::string encode(const si32 index)
|
||||
{
|
||||
return VLC->terrainTypeHandler->getByIndex(index)->identifier;
|
||||
return VLC->terrainTypeHandler->getByIndex(index)->getName();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -154,7 +154,7 @@ ZoneOptions::ZoneOptions()
|
||||
{
|
||||
for(const auto & terr : VLC->terrainTypeHandler->objects)
|
||||
if(terr->isLand() && terr->isPassable())
|
||||
terrainTypes.insert(terr->id);
|
||||
terrainTypes.insert(terr->getId());
|
||||
}
|
||||
|
||||
ZoneOptions & ZoneOptions::operator=(const ZoneOptions & other)
|
||||
@@ -365,7 +365,7 @@ void ZoneOptions::serializeJson(JsonSerializeFormat & handler)
|
||||
for(auto & ttype : terrainTypes)
|
||||
{
|
||||
JsonNode n;
|
||||
n.String() = VLC->terrainTypeHandler->getById(ttype)->identifier;
|
||||
n.String() = VLC->terrainTypeHandler->getById(ttype)->getName();
|
||||
node.Vector().push_back(n);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ void initTerrainType(Zone & zone, CMapGenerator & gen)
|
||||
std::vector<TerrainId> waterTerrains;
|
||||
for(const auto & terrain : VLC->terrainTypeHandler->objects)
|
||||
if(terrain->isWater())
|
||||
waterTerrains.push_back(terrain->id);
|
||||
waterTerrains.push_back(terrain->getId());
|
||||
|
||||
zone.setTerrainType(*RandomGeneratorUtil::nextItem(waterTerrains, gen.rand));
|
||||
}
|
||||
|
||||
@@ -323,7 +323,7 @@ void RiverPlacer::connectRiver(const int3 & tile)
|
||||
{
|
||||
auto riverType = VLC->terrainTypeHandler->getById(zone.getTerrainType())->river;
|
||||
const auto * river = VLC->riverTypeHandler->getById(riverType);
|
||||
if(river->id == River::NO_RIVER)
|
||||
if(river->getId() == River::NO_RIVER)
|
||||
return;
|
||||
|
||||
rmg::Area roads;
|
||||
|
||||
@@ -121,7 +121,7 @@ void Object::Instance::setTemplate(TerrainId terrain)
|
||||
auto templates = VLC->objtypeh->getHandlerFor(dObject.ID, dObject.subID)->getTemplates(terrain);
|
||||
if (templates.empty())
|
||||
{
|
||||
auto terrainName = VLC->terrainTypeHandler->getById(terrain)->identifier;
|
||||
auto terrainName = VLC->terrainTypeHandler->getById(terrain)->getName();
|
||||
throw rmgException(boost::to_string(boost::format("Did not find graphics for object (%d,%d) at %s") % dObject.ID % dObject.subID % terrainName));
|
||||
}
|
||||
dObject.appearance = templates.front();
|
||||
@@ -293,14 +293,14 @@ void Object::Instance::finalize(RmgMap & map)
|
||||
if (!dObject.appearance)
|
||||
{
|
||||
auto terrainType = map.map().getTile(getPosition(true)).terType;
|
||||
auto templates = VLC->objtypeh->getHandlerFor(dObject.ID, dObject.subID)->getTemplates(terrainType->id);
|
||||
auto templates = VLC->objtypeh->getHandlerFor(dObject.ID, dObject.subID)->getTemplates(terrainType->getId());
|
||||
if (templates.empty())
|
||||
{
|
||||
throw rmgException(boost::to_string(boost::format("Did not find graphics for object (%d,%d) at %s (terrain %d)") % dObject.ID % dObject.subID % getPosition(true).toString() % terrainType));
|
||||
}
|
||||
else
|
||||
{
|
||||
setTemplate(terrainType->id);
|
||||
setTemplate(terrainType->getId());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ void WaterProxy::process()
|
||||
{
|
||||
MAYBE_UNUSED(t);
|
||||
assert(map.isOnMap(t));
|
||||
assert(map.map().getTile(t).terType->id == zone.getTerrainType());
|
||||
assert(map.map().getTile(t).terType->getId() == zone.getTerrainType());
|
||||
}
|
||||
|
||||
for(auto z : map.getZones())
|
||||
@@ -54,7 +54,7 @@ void WaterProxy::process()
|
||||
|
||||
for(auto & t : z.second->area().getTilesVector())
|
||||
{
|
||||
if(map.map().getTile(t).terType->id == zone.getTerrainType())
|
||||
if(map.map().getTile(t).terType->getId() == zone.getTerrainType())
|
||||
{
|
||||
z.second->areaPossible().erase(t);
|
||||
z.second->area().erase(t);
|
||||
|
||||
Reference in New Issue
Block a user