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

Method simLoadInit

MicropolisCore/src/MicropolisEngine/src/simulate.cpp:426–530  ·  view source on GitHub ↗

comefrom: doSimInit */

Source from the content-addressed store, hash-verified

424
425/* comefrom: doSimInit */
426void Micropolis::simLoadInit()
427{
428 // Disaster delay table for each scenario
429 static const short disasterWaitTable[SC_COUNT] = {
430 0, // No scenario (free playing)
431 2, // Dullsville (boredom)
432 10, // San francisco (earth quake)
433 4 * 10, // Hamburg (fire bombs)
434 20, // Bern (traffic)
435 3, // Tokyo (scary monster)
436 5, // Detroit (crime)
437 5, // Boston (nuclear meltdown)
438 2 * 48, // Rio (flooding)
439 };
440
441 // Time to wait before score calculation for each scenario
442 static const short scoreWaitTable[SC_COUNT] = {
443 0, // No scenario (free playing)
444 30 * 48, // Dullsville (boredom)
445 5 * 48, // San francisco (earth quake)
446 5 * 48, // Hamburg (fire bombs)
447 10 * 48, // Bern (traffic)
448 5 * 48, // Tokyo (scary monster)
449 10 * 48, // Detroit (crime)
450 5 * 48, // Boston (nuclear meltdown)
451 10 * 48, // Rio (flooding)
452 };
453
454 externalMarket = (float)miscHist[1];
455 resPop = miscHist[2];
456 comPop = miscHist[3];
457 indPop = miscHist[4];
458 resValve = miscHist[5];
459 comValve = miscHist[6];
460 indValve = miscHist[7];
461 crimeRamp = miscHist[10];
462 pollutionRamp = miscHist[11];
463 landValueAverage = miscHist[12];
464 crimeAverage = miscHist[13];
465 pollutionAverage = miscHist[14];
466 gameLevel = (GameLevel)miscHist[15];
467
468 if (cityTime < 0) {
469 cityTime = 0;
470 }
471
472 if (!externalMarket) {
473 externalMarket = 4.0;
474 }
475
476 // Set game level
477 if (gameLevel > LEVEL_LAST || gameLevel < LEVEL_FIRST) {
478 gameLevel = LEVEL_FIRST;
479 }
480 setGameLevel(gameLevel);
481
482 setCommonInits();
483

Callers

nothing calls this directly

Calls 1

fillMethod · 0.80

Tested by

no test coverage detected