Exemplo n.º 1
0
/* ---------------------------------------------------------------------- *
 * Public Functions
 * ---------------------------------------------------------------------- */
void
do_time_step (void)
{
    /* Increment game time */
    total_time++;
#ifdef DEBUG_ENGINE
    printf ("In do_time_step (%d)\n", total_time);
#endif

    /* Initialize daily accumulators */
    init_daily();

    /* Initialize monthly accumulators */
    if (total_time % NUMOF_DAYS_IN_MONTH == 0) {
	init_monthly();
    }

    /* Initialize yearly accumulators */
    if ((total_time % NUMOF_DAYS_IN_YEAR) == 0) {
	init_yearly();
    }

    /* Clear the power grid */
    power_time_step ();

    /* Run through simulation equations for each farm, residence, etc. */
    simulate_mappoints ();

    /* Now do the stuff that happens once a year, once a month, etc. */
    do_periodic_events ();
}
Exemplo n.º 2
0
/* ---------------------------------------------------------------------- *
 * Public Functions
 * ---------------------------------------------------------------------- */
void do_time_step(void)
{
    if (flag_warning) {
        flag_warning = false;
        /* FIXME use blocking_dialog_open instead */
        setLincitySpeed(0);
        ok_dial_box("warning.mes", GOOD, \
                    _("Upgrading from old game. You have 10 years to build water wells where needed. After, starvation will occur!\
  You should check starvation minimap, and read waterwell help page :-)") );

    }
    /* Increment game time */
    ++total_time;
#ifdef DEBUG_ENGINE
    printf("In do_time_step (%d)\n", total_time);
#endif

    /* Initialize daily accumulators */
    init_daily();

    /* Initialize monthly accumulators */
    if (total_time % NUMOF_DAYS_IN_MONTH == 0)
    {
        init_monthly();
    }

    /* Initialize yearly accumulators */
    if ((total_time % NUMOF_DAYS_IN_YEAR) == 0)
    {
        init_yearly();
    }

    /* execute yesterdays requests OR treat loadgame requests*/
    ConstructionManager::executePendingRequests();

    /* Run through simulation equations for each farm, residence, etc. */
    simulate_mappoints();

    /* Remove all too old cars*/
    Vehicle::cleanVehicleList();

    /* Now do the stuff that happens once a year, once a month, etc. */
    do_periodic_events();
}