* Count the number of single tile houses in a residential zone. * @param pos Position of the residential zone. * @return Number of single tile houses. */
| 393 | * @return Number of single tile houses. |
| 394 | */ |
| 395 | short Micropolis::doFreePop(const Position &pos) |
| 396 | { |
| 397 | short count = 0; |
| 398 | |
| 399 | for (short x = pos.posX - 1; x <= pos.posX + 1; x++) { |
| 400 | for (short y = pos.posY - 1; y <= pos.posY + 1; y++) { |
| 401 | if (x >= 0 && x < WORLD_W && y >= 0 && y < WORLD_H) { |
| 402 | MapTile tile = map[x][y] & LOMASK; |
| 403 | if (tile >= LHTHR && tile <= HHTHR) { |
| 404 | count++; |
| 405 | } |
| 406 | } |
| 407 | } |
| 408 | } |
| 409 | |
| 410 | return count; |
| 411 | } |
| 412 | |
| 413 | |
| 414 | /** |
nothing calls this directly
no outgoing calls
no test coverage detected