Beispiel #1
0
 /// <summary>
 /// Selects the games played in a specific game mode
 /// </summary>
 public static Func<GameStats, bool> GameModeFilter(OverallVersion overallVersion)
 {
     switch (overallVersion)
     {
         case OverallVersion.arena:
             return game => game.GameMode == GameMode.Arena;
         case OverallVersion.constructed:
             return game => game.GameMode == GameMode.Ranked;
         case OverallVersion.both:
             return game => (game.GameMode == GameMode.Ranked || game.GameMode == GameMode.Arena);
         // problematic, fix it! ## dirty fix, fix it again
         case OverallVersion.auto:
             {
                 if (DeckList.Instance.ActiveDeck != null)
                 {
                     return game => game.GameMode == (DeckList.Instance.ActiveDeck.IsArenaDeck ? GameMode.Arena : GameMode.Ranked);
                 }
                 else
                 {
                     return game => false;
                 }
             }
         default:
             return game => false;
     }
 }
Beispiel #2
0
        /// <summary>
        /// Selects the games played in a specific game mode
        /// </summary>

        public static Func <GameStats, bool> GameModeFilter(OverallVersion overallVersion)
        {
            switch (overallVersion)
            {
            case OverallVersion.arena:
                return(game => game.GameMode == GameMode.Arena);

            case OverallVersion.constructed:
                return(game => game.GameMode == GameMode.Ranked);

            case OverallVersion.both:
                return(game => (game.GameMode == GameMode.Ranked || game.GameMode == GameMode.Arena));

            // problematic, fix it! ## dirty fix, fix it again
            case OverallVersion.auto:
            {
                if (DeckList.Instance.ActiveDeck != null)
                {
                    return(game => game.GameMode == (DeckList.Instance.ActiveDeck.IsArenaDeck ? GameMode.Arena : GameMode.Ranked));
                }
                else
                {
                    return(game => false);
                }
            }

            default:
                return(game => false);
            }
        }