Use structured bindings for map k,v pairs. Place counters for for range iterator loops locally inside their scopes.

This commit is contained in:
2023-12-05 22:12:43 -06:00
parent 6d4f024d3c
commit 30287c91d2
7 changed files with 93 additions and 98 deletions
+6 -6
View File
@@ -56,12 +56,12 @@ void Test::RunMapTests(){
is("There are two LowerBridgeCollision zones in Campaign I-I",
game->MAP_DATA.at(CAMPAIGN_1_1).ZoneData.count("LowerBridgeCollision")
&&game->MAP_DATA.at(CAMPAIGN_1_1).ZoneData.at("LowerBridgeCollision").size()>=2);
for(auto&key:game->MAP_DATA){
is("A Map type has been selected for map "+std::to_string(key.first),
key.second.mapType!=""&&key.second.mapType!="Unspecified");
if(key.second.mapType=="Dungeon"){
is("There is an EndZone in Dungeon "+std::to_string(key.first),
key.second.ZoneData.count("EndZone"));
for(auto&[key,value]:game->MAP_DATA){
is("A Map type has been selected for map "+std::to_string(key),
value.mapType!=""&&value.mapType!="Unspecified");
if(value.mapType=="Dungeon"){
is("There is an EndZone in Dungeon "+std::to_string(key),
value.ZoneData.count("EndZone"));
}
}
}