Ejemplo n.º 1
0
        .Round(TimeSpan.FromMinutes(5));    // rounding

        public static Raid ParseRaidInfo(this Raid raid, PokemonInfo pokemonInfo, string name, string moves = null)
        {
            if (name.StartsWith("EGG", StringComparison.OrdinalIgnoreCase)) // EGG
            {
                raid.Name = name.Substring(0, name.Length - 1);
                if (int.TryParse(name.Substring(name.Length - 1, 1), out var raidBossLevel))
                {
                    raid.RaidBossLevel = raidBossLevel;
                }
            }
            else // BOSS
            {
                raid.Name = name;
                //raid.IV = 100; // raid bosses are always 100%
                raid.RaidBossLevel = pokemonInfo.GetRaidBossLevel(name);
                raid.Pokemon       = pokemonInfo.GetPokemonNumber(name);

                if (!string.IsNullOrEmpty(moves))
                {
                    InfoGymBotHelper.ProcessMoves(moves, raid);
                }
            }

            return(raid);
        }
Ejemplo n.º 2
0
        public bool ProcessVenue(Venue venue, Raid raid)
        {
            if (VenueTitleParser.Match(venue.Title) is var match && match.Success)
            {
                var pokemon = match.Groups["title"].Value;
                raid.Pokemon       = myPokemonInfo.GetPokemonNumber(pokemon);
                raid.Name          = pokemon;
                raid.RaidBossLevel = myPokemonInfo.GetRaidBossLevel(pokemon);

                ProcessMoves(venue.Address, raid);

                return(true);
            }

            return(false);
        }