Пример #1
0
        public StatsViewModel()
        {
            _games = new List <Game>();
            Stats  = new ObservableCollection <ArchetypeRecord>();
            // initialize selection lists
            GameModes   = Enum.GetValues(typeof(GameMode)).OfType <GameMode>();
            GameFormats = Enum.GetValues(typeof(GameFormat)).OfType <GameFormat>();
            TimeFrames  = Enum.GetValues(typeof(TimeFrame)).OfType <TimeFrame>();
            Regions     = Enum.GetValues(typeof(Region)).OfType <Region>().Where(x => x != Region.UNKNOWN);
            Classes     = Enum.GetValues(typeof(PlayerClass)).OfType <PlayerClass>();
            Decks       = ViewModelHelper.GetDecksWithArchetypeGames(EndGame.Data);
            // set default selections
            SelectedGameMode = GameMode.RANKED;
            SelectedClass    = PlayerClass.ALL;
            // get remembered selections from settings
            Enum.TryParse(EndGame.Settings.Get(Strings.LastTimeFrame), out TimeFrame timeFrame);
            SelectedTimeFrame = timeFrame;
            Enum.TryParse(EndGame.Settings.Get(Strings.LastFormat), out GameFormat format);
            SelectedGameFormat = format;
            Enum.TryParse(EndGame.Settings.Get(Strings.LastRegion), out Region region);
            SelectedRegion = region;
            // get the active deck if its in the list
            SelectedDeck = ActiveOrDefaultDeck();

            RankMax = 0;
            RankMin = 25;
        }
Пример #2
0
        public async Task Update()
        {
            IsLoadingStats = true;
            await Task.Run(() =>
            {
                Decks = ViewModelHelper.GetDecksWithArchetypeGames(EndGame.Data);
            });

            SelectedDeck = ActiveOrDefaultDeck();
            UpdateStats();
            IsLoadingStats = false;
        }
Пример #3
0
 public async Task Update()
 {
     Decks        = ViewModelHelper.GetDecksWithArchetypeGames(EndGame.Data);
     SelectedDeck = ActiveOrDefaultDeck();
     UpdateStats();
 }