Пример #1
0
        private void HandleOthers(SnipePokemonViewModel model)
        {
            this.OtherList.RemoveAll(x => ShouldRemove(x, model));

            this.OtherList.Insert(0, model);

            this.RaisePropertyChanged("TotalOtherList");
            this.Refresh("OtherList", this.OtherList);
        }
Пример #2
0
        private void HandlePokedex(SnipePokemonViewModel model)
        {
            this.PokedexSnipeItems.RemoveAll(x => ShouldRemove(x, model));

            if (pokedex != null && !pokedex.Exists(p => p.PokemonId == model.PokemonId))
            {
                this.PokedexSnipeItems.Insert(0, model);
            }
            Refresh("PokedexSnipeItems", this.PokedexSnipeItems);
        }
Пример #3
0
        internal void OnSnipeData(EncounteredEvent e)
        {
            var session = TinyIoCContainer.Current.Resolve <ISession>();

            if (!e.IsRecievedFromSocket)
            {
                return;
            }
            lock (pending)
            {
                pending.Add(e);

                if (lastUpdateTime > DateTime.Now.AddSeconds(-session.LogicSettings.UIConfig.SnipeListRefreshInterval))
                {
                    return;
                }

                foreach (var item in pending)
                {
                    var         model = new SnipePokemonViewModel(item);
                    var         grade = PokemonGradeHelper.GetPokemonGrade(model.PokemonId);
                    PokemonData best  = null;

                    if (bestPokemons != null)
                    {
                        best = bestPokemons.FirstOrDefault(x => x.PokemonId == model.PokemonId);
                    }

                    if (best == null || PokemonInfo.CalculatePokemonPerfection(best) < model.IV)
                    {
                        model.Recommend = true;
                    }
                    if (model.IV >= 100)
                    {
                        Handle100IV(model);
                    }
                    else
                    if (grade == PokemonGrades.Legendary ||
                        grade == PokemonGrades.VeryRare ||
                        grade == PokemonGrades.Epic ||
                        grade == PokemonGrades.Rare)
                    {
                        HandleRarePokemon(model);
                    }
                    else
                    {
                        HandleOthers(model);
                    }

                    HandlePokedex(model);
                }
                pending.RemoveAll(x => true);
                lastUpdateTime = DateTime.Now;
            }
        }
Пример #4
0
        internal void OnSnipeItemQueue(EncounteredEvent encounteredEvent)
        {
            if (!encounteredEvent.IsRecievedFromSocket)
            {
                return;
            }
            var model = new SnipePokemonViewModel(encounteredEvent);

            model.AllowSnipe = false;
            HandleSnippingList(model);
        }
Пример #5
0
        internal void OnSnipeData(EncounteredEvent e)
        {
            if (!e.IsRecievedFromSocket)
            {
                return;
            }
            var         model = new SnipePokemonViewModel(e);
            var         grade = PokemonGradeHelper.GetPokemonGrade(model.PokemonId);
            PokemonData best  = null;

            if (bestPokemons != null)
            {
                best = bestPokemons.FirstOrDefault(x => x.PokemonId == model.PokemonId);
            }

            if (best == null || PokemonInfo.CalculatePokemonPerfection(best) < model.IV)
            {
                model.Recommend = true;
            }
            if (model.IV >= 100)
            {
                Handle100IV(model);
            }
            else
            if (grade == PokemonGrades.Legendary ||
                grade == PokemonGrades.VeryRare ||
                grade == PokemonGrades.Epic ||
                grade == PokemonGrades.Rare)
            {
                HandleRarePokemon(model);
            }
            else
            {
                HandleOthers(model);
            }

            HandlePokedex(model);
            //CHeck if pkm not in
        }
Пример #6
0
 private void HandleSnippingList(SnipePokemonViewModel model)
 {
     this.SnipeQueueItems.Insert(0, model);
     this.Refresh("SnipeQueueItems", this.SnipeQueueItems);
 }
Пример #7
0
 private void Handle100IV(SnipePokemonViewModel e)
 {
     this.IV100List.RemoveAll(x => ShouldRemove(x, e));
     this.IV100List.Insert(0, e);
     this.Refresh("IV100List", this.IV100List);
 }
Пример #8
0
 private void HandleRarePokemon(SnipePokemonViewModel model)
 {
     this.RareList.RemoveAll(x => ShouldRemove(x, model));
     this.RareList.Insert(0, model);
     this.Refresh("RareList", this.RareList);
 }
Пример #9
0
 private void Handle100IV(SnipePokemonViewModel e)
 {
     this.IV100List.Insert(0, e);
     this.Refresh(this.IV100List);
 }
Пример #10
0
 private void HandleRarePokemon(SnipePokemonViewModel model)
 {
     this.RareList.Insert(0, model);
     this.Refresh(this.RareList);
 }
Пример #11
0
 private void HandleOthers(SnipePokemonViewModel model)
 {
     this.OtherList.Insert(0, model);
     this.Refresh(this.OtherList);
     this.RaisePropertyChanged("TotalOtherList");
 }