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

Method loadScenario

MicropolisCore/src/MicropolisEngine/src/fileio.cpp:404–495  ·  view source on GitHub ↗

* Load a scenario. * @param s Scenario to load. * @note \a s cannot be \c SC_NONE. */

Source from the content-addressed store, hash-verified

402 * @note \a s cannot be \c SC_NONE.
403 */
404void Micropolis::loadScenario(Scenario s)
405{
406 const char *name = NULL;
407 const char *fname = NULL;
408
409 cityFileName = "";
410
411 setGameLevel(LEVEL_EASY);
412
413 if (s < SC_DULLSVILLE || s > SC_RIO) {
414 s = SC_DULLSVILLE;
415 }
416
417 switch (s) {
418 case SC_DULLSVILLE:
419 name = "Dullsville";
420 fname = "snro.111";
421 scenario = SC_DULLSVILLE;
422 cityTime = ((1900 - 1900) * 48) + 2;
423 setFunds(5000);
424 break;
425 case SC_SAN_FRANCISCO:
426 name = "San Francisco";
427 fname = "snro.222";
428 scenario = SC_SAN_FRANCISCO;
429 cityTime = ((1906 - 1900) * 48) + 2;
430 setFunds(20000);
431 break;
432 case SC_HAMBURG:
433 name = "Hamburg";
434 fname = "snro.333";
435 scenario = SC_HAMBURG;
436 cityTime = ((1944 - 1900) * 48) + 2;
437 setFunds(20000);
438 break;
439 case SC_BERN:
440 name = "Bern";
441 fname = "snro.444";
442 scenario = SC_BERN;
443 cityTime = ((1965 - 1900) * 48) + 2;
444 setFunds(20000);
445 break;
446 case SC_TOKYO:
447 name = "Tokyo";
448 fname = "snro.555";
449 scenario = SC_TOKYO;
450 cityTime = ((1957 - 1900) * 48) + 2;
451 setFunds(20000);
452 break;
453 case SC_DETROIT:
454 name = "Detroit";
455 fname = "snro.666";
456 scenario = SC_DETROIT;
457 cityTime = ((1972 - 1900) * 48) + 2;
458 setFunds(20000);
459 break;
460 case SC_BOSTON:
461 name = "Boston";

Callers 1

loadMetaScenarioMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected