1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

Fix code style & formatting

This commit is contained in:
Ivan Savenko
2024-02-19 15:58:44 +02:00
parent fe918de2df
commit c513dc1bc7

View File

@@ -767,7 +767,7 @@ void CGameState::initStartingBonus()
void CGameState::initTownNames()
{
std::map<FactionID, std::vector<int>> availableNames;
for (auto const & faction : VLC->townh->getDefaultAllowed())
for(const auto & faction : VLC->townh->getDefaultAllowed())
{
std::vector<int> potentialNames;
if(faction.toFaction()->town->getRandomNamesCount() > 0)
@@ -779,9 +779,8 @@ void CGameState::initTownNames()
}
}
for (auto & elem : map->towns)
for(auto & vti : map->towns)
{
CGTownInstance * vti =(elem);
assert(vti->town);
if(!vti->getNameTextID().empty())
@@ -822,14 +821,13 @@ void CGameState::initTowns()
map->townUniversitySkills.push_back(SecondarySkill(SecondarySkill::WATER_MAGIC));
map->townUniversitySkills.push_back(SecondarySkill(SecondarySkill::EARTH_MAGIC));
for (auto & elem : map->towns)
for (auto & vti : map->towns)
{
CGTownInstance * vti =(elem);
assert(vti->town);
static const BuildingID basicDwellings[] = { BuildingID::DWELL_FIRST, BuildingID::DWELL_LVL_2, BuildingID::DWELL_LVL_3, BuildingID::DWELL_LVL_4, BuildingID::DWELL_LVL_5, BuildingID::DWELL_LVL_6, BuildingID::DWELL_LVL_7 };
static const BuildingID upgradedDwellings[] = { BuildingID::DWELL_UP_FIRST, BuildingID::DWELL_LVL_2_UP, BuildingID::DWELL_LVL_3_UP, BuildingID::DWELL_LVL_4_UP, BuildingID::DWELL_LVL_5_UP, BuildingID::DWELL_LVL_6_UP, BuildingID::DWELL_LVL_7_UP };
static const BuildingID hordes[] = { BuildingID::HORDE_PLACEHOLDER1, BuildingID::HORDE_PLACEHOLDER2, BuildingID::HORDE_PLACEHOLDER3, BuildingID::HORDE_PLACEHOLDER4, BuildingID::HORDE_PLACEHOLDER5, BuildingID::HORDE_PLACEHOLDER6, BuildingID::HORDE_PLACEHOLDER7 };
constexpr std::array basicDwellings = { BuildingID::DWELL_FIRST, BuildingID::DWELL_LVL_2, BuildingID::DWELL_LVL_3, BuildingID::DWELL_LVL_4, BuildingID::DWELL_LVL_5, BuildingID::DWELL_LVL_6, BuildingID::DWELL_LVL_7 };
constexpr std::array upgradedDwellings = { BuildingID::DWELL_UP_FIRST, BuildingID::DWELL_LVL_2_UP, BuildingID::DWELL_LVL_3_UP, BuildingID::DWELL_LVL_4_UP, BuildingID::DWELL_LVL_5_UP, BuildingID::DWELL_LVL_6_UP, BuildingID::DWELL_LVL_7_UP };
constexpr std::array hordes = { BuildingID::HORDE_PLACEHOLDER1, BuildingID::HORDE_PLACEHOLDER2, BuildingID::HORDE_PLACEHOLDER3, BuildingID::HORDE_PLACEHOLDER4, BuildingID::HORDE_PLACEHOLDER5, BuildingID::HORDE_PLACEHOLDER6, BuildingID::HORDE_PLACEHOLDER7 };
//init buildings
if(vstd::contains(vti->builtBuildings, BuildingID::DEFAULT)) //give standard set of buildings