* If needed, add a new hospital or a new church. * @param pos Center position of the new hospital or church. */
| 276 | * @param pos Center position of the new hospital or church. |
| 277 | */ |
| 278 | void Micropolis::makeHospital(const Position &pos) |
| 279 | { |
| 280 | if (needHospital > 0) { |
| 281 | zonePlop(pos, HOSPITAL - 4); |
| 282 | needHospital = 0; |
| 283 | return; |
| 284 | } |
| 285 | |
| 286 | if (needChurch > 0) { |
| 287 | int churchType = getRandom(7); // 0 to 7 inclusive |
| 288 | int tile; |
| 289 | if (churchType == 0) { |
| 290 | tile = CHURCH0; |
| 291 | } else { |
| 292 | tile = CHURCH1 + ((churchType - 1) * 9); |
| 293 | } |
| 294 | |
| 295 | //printf("NEW CHURCH tile %d x %d y %d type %d\n", tile, pos.posX, pos.posY, churchType); |
| 296 | |
| 297 | zonePlop(pos, tile - 4); |
| 298 | needChurch = 0; |
| 299 | return; |
| 300 | } |
| 301 | } |
| 302 | |
| 303 | /** |
| 304 | * Compute land value at \a pos, taking pollution into account. |
nothing calls this directly
no outgoing calls
no test coverage detected