| 3207 | } |
| 3208 | |
| 3209 | void GameMap::notifySeatsConfigured() |
| 3210 | { |
| 3211 | mTeamIds.clear(); |
| 3212 | // We always add the rogue team id |
| 3213 | mTeamIds.push_back(0); |
| 3214 | |
| 3215 | for(Seat* seat : mSeats) |
| 3216 | { |
| 3217 | if(seat->isRogueSeat()) |
| 3218 | continue; |
| 3219 | |
| 3220 | uint32_t teamIndex = 0; |
| 3221 | for(int teamId : mTeamIds) |
| 3222 | { |
| 3223 | if(teamId == seat->getTeamId()) |
| 3224 | break; |
| 3225 | |
| 3226 | ++teamIndex; |
| 3227 | } |
| 3228 | |
| 3229 | // If the team id was not in the list, save it |
| 3230 | if(teamIndex == mTeamIds.size()) |
| 3231 | mTeamIds.push_back(seat->getTeamId()); |
| 3232 | |
| 3233 | seat->setTeamIndex(teamIndex); |
| 3234 | } |
| 3235 | |
| 3236 | uint32_t nbTeams = mTeamIds.size(); |
| 3237 | for(int xxx = 0; xxx < getMapSizeX(); ++xxx) |
| 3238 | { |
| 3239 | for(int yyy = 0; yyy < getMapSizeY(); ++yyy) |
| 3240 | { |
| 3241 | Tile* tile = getTile(xxx, yyy); |
| 3242 | if(tile == nullptr) |
| 3243 | continue; |
| 3244 | |
| 3245 | tile->setTeamsNumber(nbTeams); |
| 3246 | } |
| 3247 | } |
| 3248 | // Now that team ids are set and tiles are configured, we can compute floodfill |
| 3249 | enableFloodFill(); |
| 3250 | } |
| 3251 | |
| 3252 | void GameMap::fireGameSound(Tile& tile, const std::string& soundFamily) |
| 3253 | { |
no test coverage detected