コード例 #1
0
    void GenerateNewWorld()
    {
        // tutorial
        var e      = Q.CreateEntity();
        var popups = Q.CreateEntity();

        e.AddTutorial(new Dictionary <TutorialFunctionality, bool>());
        e.AddEventContainer(new Dictionary <string, bool>());

        // date

        e.AddSimpleCooldownContainer(new Dictionary <string, SimpleCooldown>());

        e.AddDate(0);
        e.AddSpeed(2);
        e.AddProfiling(0, new StringBuilder(), new Dictionary <string, long>());

        //e.AddTargetDate(0);

        // game is paused already
        //ScheduleUtils.PauseGame(Q);

        e.AddGameEventContainer(new List <GameEvent>());

        // menu
        ScreenUtils.CreateMenu(e);
        //var c = ScreenUtils.GetMenu(Q);

        // Notifications and Popups
        e.AddNotifications(new List <NotificationMessage>());
        e.AddPopup(new List <PopupMessage>());
        e.AddSeenPopups(new List <PopupType>());

        // reports & stats
        e.AddReports(new List <AnnualReport>());
        e.AddCampaignStats(new Dictionary <CampaignStat, int>
        {
            [CampaignStat.Acquisitions]      = 0,
            [CampaignStat.Bankruptcies]      = 0,
            [CampaignStat.PromotedCompanies] = 0,
            [CampaignStat.SpawnedFunds]      = 0
        });

        SpawnMarkets();

        SpawnHistoricalCompanies();

        SpawnCompanies();
    }