public string GetFriendlyTitle(TitleIndices index = TitleIndices.EnglishIndex) { string title = GetTitleAsNullIfDefault(index); return(title != null ? string.Join(' ', title.Split('\n').Select(l => l.Trim(' ', '\0')).ToArray()) : null); }
public string GetTitleOnly(TitleIndices index = TitleIndices.EnglishIndex) { string title = GetTitleAsNullIfDefault(index); if (title == null) { return(null); } string[] titleParts = title.Split('\n'); return(string.Join(' ', titleParts .Take(titleParts.Length > 1 ? titleParts.Length - 1 : titleParts.Length) .Select(l => l.Trim(' ', '\0')) .ToArray())); }
public string GetProperName(bool withGameCode = false, TitleIndices index = TitleIndices.EnglishIndex) { if (withGameCode) { if (Titles[(int)index] != null) { return($"{GameCode} - {GameTitle} - {GetFriendlyTitle(index)}"); } if (GameTitle != null) { return($"{GameCode} - {GameTitle}"); } return(GameCode); } if (Titles[(int)index] != null) { return($"{GameTitle} - {GetFriendlyTitle(index)}"); } return(GameTitle); }
internal static Language.LanguageCodes TitleIndexToLanguageCode(TitleIndices index) => index switch {
internal string GetTitle(TitleIndices index = TitleIndices.EnglishIndex) => Titles[(int)index];
internal string GetTitleAsNullIfDefault(TitleIndices index = TitleIndices.EnglishIndex) => !string.Equals(Titles[(int)index], DefaultTitle, StringComparison.InvariantCultureIgnoreCase) ? Titles[(int)index] : null;