public void ProcessVallisCycle(NotificationState state, VallisCycle vallis) { var sendFCM = ProcessSingleExpirable(state, vallis, vallis.StatType); if (sendFCM) { var ttl = vallis.TimeLeft; var message = FCM.CreateMessage($"Orb Vallis {vallis.State.ToUpperFirst()}", vallis.ShortString, platform, YawsNotification.Topic.VallisCycle, nameof(VallisCycle), ttl); NotificationMessages.Add(message); } }
public static string ToString(VallisCycle cycle) { var time = (cycle.expiry - DateTime.Now).Humanize(int.MaxValue, CultureInfo.GetCultureInfo("zh-CN"), TimeUnit.Hour, TimeUnit.Second, " "); var temp = cycle.isWarm ? "温暖" : "寒冷"; var nextTemp = !cycle.isWarm ? "温暖" : "寒冷"; var sb = new StringBuilder(); sb.AppendLine($"现在金星平原的温度是: {temp}"); //sb.AppendLine($"将在{cycle.expiry} 变为 {nextTemp}"); sb.Append($"距离 {nextTemp} 还有 {time}"); return(sb.ToString()); }