示例#1
0
    void StartNewGame() // This works with next levels, too
    {
        gameStarted = true;

        if (currentDifficultyLevel >= difficultyLevels.Length)
        {
            //Trick to keep replaying the 5th day after having passed that
            currentDifficultyLevel = difficultyLevels.Length - 1;
        }

        SetDifficultyLevel(difficultyLevels[currentDifficultyLevel]);

        UpdateScoresMenu();

        FindTheZones();
        possibleCustomersPool = CustomerImporter.ProcessCSV(csv);
        print("SAVING THE START GAME!");
        // print("MAX GAMMS " + LevelSerializer.MaxGames);
        //print("MAX GAMMS " + LevelSerializer.MaxGames);

        LevelSerializer.MaxGames = 1;

        LevelSerializer.SaveGame("base", false, null);

        AddRandomCustomer();
        StartCoroutine("DelayedAddingOfCustomers");
    }
示例#2
0
    protected void uxCustomerImportButton_Click(object sender, EventArgs e)
    {
        uxImportCustomerMessagePanel.Controls.Clear();
        string localFilePath = Server.MapPath("~/" + uxCustomerCsvFileNameText.Text.Trim());

        if (!File.Exists(localFilePath))
        {
            Label label = new Label();
            label.ForeColor = Color.Red;
            label.Text      = "File not found.";
            uxImportCustomerMessagePanel.Controls.Add(label);
            return;
        }

        CustomerImporter     importer = new CustomerImporter();
        CustomerImportStatus status   = new CustomerImportStatus();
        TimeSpan             timeDiff;

        switch (uxCustomerImportModeRadioList.SelectedValue)
        {
        case "Overwrite":
            status = importer.ImportCustomerOverWrite(
                "~/" + uxCustomerCsvFileNameText.Text.Trim(), out timeDiff);
            UpdateImportMessage(status, uxImportCustomerMessagePanel, true);
            UpdateTimeMessage(timeDiff, uxImportCustomerMessagePanel);
            break;

        default: break;
        }

        AdminUtilities.ClearAllCache();
    }
示例#3
0
 public CustomerImporterWorker(
     LogWriter logger,
     ILogin login,
     TaskSchedule task,
     ApplicationControl appControl)
     : base(logger, login, task, appControl)
 {
     Importer = new CustomerImporter(Login, appControl);
 }