Use structured bindings for map k,v pairs. Place counters for for range iterator loops locally inside their scopes.
This commit is contained in:
+6
-6
@@ -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"));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user