public RomajiHelper() { if (RomajiToZhDict == null) { RomajiToZhDict = new Dictionary <string, string>(); foreach (var pluginRomajiPair in kouContext.Set <RomajiPair>().ToList()) { RomajiToZhDict.Add(pluginRomajiPair.RomajiKey, pluginRomajiPair.ZhValue); } } }
public override object Default(string name = null) { if (_kouContext.Set <PluginArcaeaSong>().IsNullOrEmptySet()) { return("曲库为空"); //BUG 更新后无法进行判断是否为空 } if (SystemExpand.All(string.IsNullOrWhiteSpace, name, ChartConstant, SongName, SongArtist, ChartDesigner, RatingClass, Rating, NotesCount, JacketDesigner, SongLength, SongBPM)) { return("嗯?"); } if (SongName.IsNullOrWhiteSpace()) { SongName = name; } List <PluginArcaeaSong> satisfiedSongs = GetSatisfiedSong(); if (satisfiedSongs.IsNullOrEmptySet()) { return("找不到符合条件的歌曲"); } return(satisfiedSongs.ToAutoPageSetString()); //else if (satisfiedSongs.Count == 1) //{ // return satisfiedSongs.First().ToString(FormatType.Detail); //} //else //{ // if (Count == -1) Count = 10; // Count = Count.LimitInRange(1, 20); // string result = ""; // if (All) // { // Count = Count.LimitInRange(7); // for (int i = 0; i < Count && i < satisfiedSongs.Count; i++) // { // result += $"-------{AutoFormatSong(satisfiedSongs[i])}\n"; // } // } // else // { // for (int i = 0; i < Count && i < satisfiedSongs.Count; i++) // { // result += $"{satisfiedSongs[i].ToString(FormatType.Brief)}\n"; // } // } // result += satisfiedSongs.Count - Count > 0 ? $"还有{satisfiedSongs.Count - Count}个结果..." : null; // return result.Trim(); //} }