MCPcopy Create free account
hub / github.com/SimHacker/micropolis / makeHospital

Method makeHospital

MicropolisCore/src/MicropolisEngine/src/zone.cpp:278–301  ·  view source on GitHub ↗

* If needed, add a new hospital or a new church. * @param pos Center position of the new hospital or church. */

Source from the content-addressed store, hash-verified

276 * @param pos Center position of the new hospital or church.
277 */
278void 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.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected