1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-12-01 23:12:49 +02:00

* Map size can be any integer value * Changed new_*; to new_*(); for zero-parameter c-tors (=code convention; stack allocated objects without parantheses as ever to avoid c++ most vexing parse)

This commit is contained in:
beegee1
2012-11-13 18:01:31 +00:00
parent f5ddc44827
commit e08db9790b
6 changed files with 142 additions and 103 deletions

View File

@@ -1,21 +1,45 @@
#include "StdInc.h"
#include "CMapGenOptions.h"
CMapGenOptions::CMapGenOptions() : mapSize(EMapSize::MEDIUM), hasTwoLevels(true),
CMapGenOptions::CMapGenOptions() : width(72), height(72), hasTwoLevels(true),
playersCnt(-1), teamsCnt(-1), compOnlyPlayersCnt(-1), compOnlyTeamsCnt(-1),
waterContent(EWaterContent::NORMAL), monsterStrength(EMonsterStrength::NORMAL)
{
}
EMapSize::EMapSize CMapGenOptions::getMapSize() const
int CMapGenOptions::getWidth() const
{
return mapSize;
return width;
}
void CMapGenOptions::setMapSize(EMapSize::EMapSize value)
void CMapGenOptions::setWidth(int value)
{
mapSize = value;
if(value > 0)
{
width = value;
}
else
{
throw std::runtime_error("Map width lower than 1 not allowed.");
}
}
int CMapGenOptions::getHeight() const
{
return height;
}
void CMapGenOptions::setHeight(int value)
{
if(value > 0)
{
height = value;
}
else
{
throw std::runtime_error("Map height lower than 1 not allowed.");
}
}
bool CMapGenOptions::getHasTwoLevels() const