示例#1
0
 ITheme GetThemeOrDefault(Guid guid)
 {
     if (themes.TryGetValue(guid, out var theme))
     {
         return(theme);
     }
     if (themes.TryGetValue(DefaultThemeGuid, out theme))
     {
         return(theme);
     }
     return(AllThemes.FirstOrDefault());
 }
示例#2
0
        /// <summary> Fetches a random, unlocked theme.
        /// This can be the same as the currently used theme. </summary>
        public Theme GetRandomTheme()
        {
            var unlocked = AllThemes.Where(t => t.Unlocked).ToList();

            return(unlocked[RNG.Next(unlocked.Count)]);
        }