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"); }
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(); }
public CustomerImporterWorker( LogWriter logger, ILogin login, TaskSchedule task, ApplicationControl appControl) : base(logger, login, task, appControl) { Importer = new CustomerImporter(Login, appControl); }