/// <summary> /// Checks whether the game load parameters are valid and returns whether validation is a success. /// </summary> private bool ValidateLoadParams(IPlayableMap map, IModeService modeService) { // If invalid parameters, loading must fail. if (map == null) { NotificationBox?.Add(new Notification() { Message = "Map is not specified!", Type = NotificationType.Error }); loadState.Value = GameLoadState.Fail; return(false); } if (modeService == null) { NotificationBox?.Add(new Notification() { Message = "Game mode is not specified!", Type = NotificationType.Error }); loadState.Value = GameLoadState.Fail; return(false); } return(true); }
private IEnumerator AddNotification(int lines, NotificationScope scope) { string message = string.Join("\n", Enumerable.Range(0, lines).Select(i => "asdf" + i)); NotificationBox.Add(new Notification() { Message = message, Type = GetNotificationType(), Scope = scope, }); yield break; }