1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-23 00:28:08 +02:00

Merge branch 'develop' of https://github.com/vcmi/vcmi into RMG

This commit is contained in:
DjWarmonger
2014-06-01 21:53:00 +02:00
6 changed files with 25 additions and 16 deletions

View File

@ -20,7 +20,7 @@ void CMapGenerator::foreach_neighbour(const int3 &pos, std::function<void(int3&
{
int3 n = pos + dir;
if(map->isInTheMap(n))
foo(pos+dir);
foo(n);
}
}
@ -191,7 +191,6 @@ void CMapGenerator::genZones()
zones = tmpl->getZones(); //copy from template (refactor?)
int player_per_side = zones.size() > 4 ? 3 : 2;
int zones_cnt = zones.size() > 4 ? 9 : 4;
logGlobal->infoStream() << boost::format("Map size %d %d, players per side %d") % w % h % player_per_side;
@ -200,9 +199,6 @@ void CMapGenerator::genZones()
placer.assignZones(mapGenOptions);
int i = 0;
int part_w = w/player_per_side;
int part_h = h/player_per_side;
for(auto const it : zones)
{
@ -328,7 +324,7 @@ bool CMapGenerator::isFree(const int3 &tile) const
return tiles[tile.x][tile.y][tile.z].isFree();
}
void CMapGenerator::setOccupied(int3 &tile, ETileType::ETileType state)
void CMapGenerator::setOccupied(const int3 &tile, ETileType::ETileType state)
{
if (!map->isInTheMap(tile))
throw rmgException(boost::to_string(boost::format("Tile %s is outside the map") % tile));
@ -336,7 +332,7 @@ void CMapGenerator::setOccupied(int3 &tile, ETileType::ETileType state)
tiles[tile.x][tile.y][tile.z].setOccupied(state);
}
CTileInfo CMapGenerator::getTile(int3 tile) const
CTileInfo CMapGenerator::getTile(const int3& tile) const
{
if (!map->isInTheMap(tile))
throw rmgException(boost::to_string(boost::format("Tile %s is outside the map") % tile));
@ -363,4 +359,4 @@ int CMapGenerator::getNearestObjectDistance(const int3 &tile) const
int CMapGenerator::getNextMonlithIndex()
{
return monolithIndex++;
}
}