* Get population of a zone. * @param pos Position of the zone to count. * @param tile Tile of the zone. * @return Population of the zone. */
| 186 | * @return Population of the zone. |
| 187 | */ |
| 188 | int Micropolis::getPopulationDensity(const Position &pos, MapTile tile) |
| 189 | { |
| 190 | int pop; |
| 191 | |
| 192 | if (tile == FREEZ) { |
| 193 | pop = doFreePop(pos); |
| 194 | return pop; |
| 195 | } |
| 196 | |
| 197 | if (tile < COMBASE) { |
| 198 | pop = getResZonePop(tile); |
| 199 | return pop; |
| 200 | } |
| 201 | |
| 202 | if (tile < INDBASE) { |
| 203 | pop = getComZonePop(tile) * 8; |
| 204 | return pop; |
| 205 | } |
| 206 | |
| 207 | if (tile < PORTBASE) { |
| 208 | pop = getIndZonePop(tile) * 8; |
| 209 | return pop; |
| 210 | } |
| 211 | |
| 212 | return 0; |
| 213 | } |
| 214 | |
| 215 | |
| 216 | /* comefrom: simulate SpecialInit */ |
nothing calls this directly
no outgoing calls
no test coverage detected