from discord.ext import commands

from src.Logic.PlayerLogic import PlayerLogic


class Pokedex(commands.Cog, name="Pokedex"):

    def __init__(self, bot):
        self.bot = bot

    @commands.command(name="pPokeDex")
    async def pokedex(self, ctx):
        """shows your pokedex progress"""
        pokedex_info_dict = PlayerLogic.get_pokedex_for_player(ctx.message.author.id)
        num_found_pokemon = sum(1 for condition in pokedex_info_dict.values() if condition)

        await ctx.channel.send(f"```Total: {len(pokedex_info_dict)} \nFound: {num_found_pokemon}\nMissing: {len(pokedex_info_dict) - num_found_pokemon}```")


    @commands.command(name="pPokeDexInfo")
    async def pokedex_info(self, ctx, pokemon_name: str):
        """shows information for the specified pokemon if you already encounterd it"""
        pokedex_entry = PlayerLogic.get_pokedex_entry_for_player(ctx.message.author.id, pokemon_name)

        await ctx.channel.send(f"```ID {pokedex_entry.pokedex_id}\nName {pokedex_entry.pokemon_name}```")


def setup(bot):
    bot.add_cog(Pokedex(bot))
from discord.ext import commands

from src.Logic.PlayerLogic import PlayerLogic


class Pokedex(commands.Cog, name="Pokedex"):

    def __init__(self, bot):
        self.bot = bot

    @commands.command(name="pPokeDex")
    async def pokedex(self, ctx):
        """shows your pokedex progress"""
        pokedex_info_dict = PlayerLogic.get_pokedex_for_player(ctx.message.author.id)
        num_found_pokemon = sum(1 for condition in pokedex_info_dict.values() if condition)

        await ctx.channel.send(f"```Total: {len(pokedex_info_dict)} \nFound: {num_found_pokemon}\nMissing: {len(pokedex_info_dict) - num_found_pokemon}```")


    @commands.command(name="pPokeDexInfo")
    async def pokedex_info(self, ctx, pokemon_name: str):
        """shows information for the specified pokemon if you already encounterd it"""
        pokedex_entry = PlayerLogic.get_pokedex_entry_for_player(ctx.message.author.id, pokemon_name)

        await ctx.channel.send(f"```ID {pokedex_entry.pokedex_id}\nName {pokedex_entry.pokemon_name}```")


def setup(bot):
    bot.add_cog(Pokedex(bot))
shows your pokedex progress shows information for the specified pokemon if you already encounterd it