Exemplo n.º 1
0
 public void TranslateNightWave(WFNightWave nightwave)
 {
     foreach (var challenge in nightwave.activeChallenges)
     {
         challenge.desc   = nightwaveTranslator.Translate(challenge.desc.Format().Replace(",", ""));
         challenge.title  = nightwaveTranslator.Translate(challenge.title.Format());
         challenge.expiry = GetRealTime(challenge.expiry);
     }
 }
Exemplo n.º 2
0
        public static string ToString(WFNightWave nightwave)
        {
            var sb = new StringBuilder();

            sb.AppendLine("以下是午夜电波挑战: ");
            sb.AppendLine();
            var onedayleft =
                nightwave.activeChallenges.Where(challenge => challenge.expiry - DateTime.Now < TimeSpan.FromDays(1));
            var elsechallenges = nightwave.activeChallenges.ToList();

            elsechallenges.RemoveAll(challenge => challenge.expiry - DateTime.Now < TimeSpan.FromDays(1));
            var challenges = elsechallenges;

            if (onedayleft.Any())
            {
                sb.AppendLine("一天内将会过期: ");
                sb.AppendLine("    " + ToString(onedayleft.ToList(), true));
            }

            challenges = elsechallenges.Where(challenge => challenge.isDaily).ToList();
            if (challenges.Any())
            {
                sb.AppendLine($"每日挑战({challenges.First().reputation}): ");
                sb.AppendLine("    " + ToString(challenges, false));
            }

            challenges = elsechallenges.Where(challenge => !challenge.isDaily && !challenge.isElite).ToList();
            if (challenges.Any())
            {
                sb.AppendLine($"每周挑战({challenges.First().reputation}): ");
                sb.AppendLine("    " + ToString(challenges, false));
            }

            challenges = elsechallenges.Where(challenge => challenge.isElite).ToList();
            if (challenges.Any())
            {
                sb.AppendLine($"精英每周挑战({challenges.First().reputation}): ");
                sb.AppendLine("    " + ToString(challenges, false));
            }
            // 不要尝试去读这个
            // 你会发现我真是个傻逼
            // 其实 也有点大智若愚的感觉
            return(sb.ToString().Trim());
        }