public void PauseGameButtonClickHandler() { if (roundManager.phase == GamePhase.Simulation) { notificationSystem.Notify(NotificationType.Warning, "Cannot Pause the game during the simulation phase"); return; } PauseGame(); }
public static void Main(string[] args) { NotificationSystem notificationSystem1 = new NotificationSystem(new Email()); NotificationSystem notificationSystem2 = new NotificationSystem(new Sms()); notificationSystem1.Notify(); notificationSystem2.Notify(); }
private void ShowNotification() { NotificationSystem notificationSystem = GameObject.Find("NotificationSystem").GetComponent <NotificationSystem>(); string content = "Oil spilling happens. Please take an oil-cleaning action in the Oil Cleaning tab"; notificationSystem.Notify(NotificationType.Disaster, content); }
private void Absorb() { if (!playerSouls.soulReady) { playerSouls.soulReady = true; notificationSystem.Notify(soulNotif); Destroy(this.gameObject); } }
private void LearnScroll() { string text = "You learned " + spell.name + "!"; notificationSystem.Notify(text); spell.GetComponent <Button>().interactable = true; Destroy(this.gameObject); }
private void CreateNotification() { NotificationSystem notificationSystem = GameObject.Find("NotificationSystem").GetComponent <NotificationSystem>(); Ship ship = shipGenerationEvent.Ship; string content = String.Format("{0} ship {1} arrived at anchor field and is waiting for scheduling.", ship.Industry.ToString(), ship.Name); notificationSystem.Notify(NotificationType.Information, content); }
public void Burn() { if (hasShipInOilArea()) { notificationSystem.Notify(NotificationType.Warning, "Cannot burn. There are one or more ships in the oil-polluted area"); return; } StopTraffic(); solution = OilSpillSolution.Burn; budgetCounter.SpendMoney(1000000); SetCleaningSpeed(); DisableAllToggles(); logger.LogOilCleaning(OilSpillSolution.Burn); }
public void SubmitAndContinueButtonClickHandler() { if (GameObject.Find("SceneSetting").GetComponent <SceneSetting> ().GiveRecommendation) { if (!recommendataionSystem.recommendationRequested || !recommendataionSystem.isAllRecommendationsProcessed()) { notificationSystem.Notify(NotificationType.Warning, "Please request your recommendations and process them before submit."); return; } } SubmitAndContinue(); }
public void Update() { if (Input.GetKeyDown(viewCode) && CheckModifiers(ref viewModifiers)) { Debug.LogFormat("[LogfileHotkey] \"View Logfile\" hotkey pressed."); Notifier.Notify("Opening Log", "Uploading log and opening in default browser..."); LogfileUploader.Instance.Open(keySettings.copyLogfileLinkWhenViewed != null && (bool)keySettings.copyLogfileLinkWhenViewed); } if (Input.GetKeyDown(clearCode) && CheckModifiers(ref clearModifiers)) { Debug.LogFormat("[LogfileHotkey] \"Clear Logfile\" hotkey pressed."); LogfileUploader.Instance.Clear(); Debug.LogFormat("[LogfileHotkey] Cleared internal log file"); Notifier.Warning("Log Cleared", "Internal log file was cleared."); } if (Input.GetKeyDown(viewLastBombCode) && CheckModifiers(ref viewLastBombModifiers)) { Debug.LogFormat("[LogfileHotkey] \"View Last Bomb Logfile\" hotkey pressed."); Notifier.Notify("Opening Log (Last Bomb)", "Uploading log of the latest bomb and opening in default browser..."); LogfileUploader.Instance.OpenLastBomb(keySettings.copyLogfileLinkWhenViewed != null && (bool)keySettings.copyLogfileLinkWhenViewed); } if (Input.GetKeyDown(copyCode) && CheckModifiers(ref copyModifiers)) { Debug.LogFormat("[LogfileHotkey] \"Copy Logfile Link\" hotkey pressed."); if (keySettings.copyLogfileForJustLastBomb != null && (bool)keySettings.copyLogfileForJustLastBomb) { Notifier.Notify("Copying Log Link (Last Bomb)", "Uploading log of the latest bomb and copying link..."); LogfileUploader.Instance.OpenLastBomb(true, false); } else { Notifier.Notify("Copying Log Link", "Uploading log and copying link..."); LogfileUploader.Instance.Open(true, false); } } }
private IEnumerator DoPost(string data, bool openLink, bool copyLink) { uploadError = false; data = "Initialize engine version: Log Viewer Hotkey\n" + data; byte[] encodedData = System.Text.Encoding.UTF8.GetBytes(data); int dataLength = encodedData.Length; bool tooLong = false; foreach (LogService service in services) { uploadError = false; string baseURL = service.BaseURL; int uploadLimit = service.UploadLimit; tooLong = false; if (dataLength >= uploadLimit) { Debug.LogFormat("[LogfileHotkey] Data ({0}B) is too long for {1} ({2}B)", dataLength, baseURL, uploadLimit); tooLong = true; continue; } Debug.LogFormat("[LogfileHotkey] Attempting to post log to {0}", baseURL); Notifier.Notify("Uploading Log", "Attempting to upload log to \"" + baseURL + "\"..."); yield return(StartCoroutine(service.Upload(encodedData, openLink, copyLink, data))); if (uploadError) { //Debug.Log("[LogfileHotkey] Error uploading log file: upload error."); //Notifier.Error("Error Uploading Log", "An unexpected error occurred."); continue; } else { break; } } if (tooLong) { Debug.Log("[LogfileHotkey] Error uploading log file: too long."); Notifier.Error("Error Uploading Log", "Log file was too long to upload."); } }
public void ToggleSignal() { if (inDecisionMode) { isGreenSignal = !isGreenSignal; NetworkScheduler networkScheduler = GameObject.Find("NetworkScheduler").GetComponent <NetworkScheduler> (); if (isGreenSignal) { networkScheduler.MoveShipToPriorityQueue(shipController); GameObject.Find("BasicLoggerManager").GetComponent <VistaLightsLogger> ().LogRedGreenSignal(shipController.Ship, "green signal"); } else { networkScheduler.MoveShipToWaitList(shipController); GameObject.Find("BasicLoggerManager").GetComponent <VistaLightsLogger> ().LogRedGreenSignal(shipController.Ship, "red signal"); } shipListController.UpdateAllPriorityInput(); } else { NotificationSystem notificationSystem = GameObject.Find("NotificationSystem").GetComponent <NotificationSystem> (); notificationSystem.Notify(NotificationType.Warning, "Signal to ship can only be set in decision phase"); } }