示例#1
0
        /// <summary>
        /// Suma una cantidad de boxes a la PC
        /// </summary>
        static void AgregarBoxes()
        {
            Menu.HeaderPrincipal();

            int cantBoxes;

            Console.Write("Ingrese cuantas boxes desea agregar: ");

            while (!int.TryParse(Console.ReadLine(), out cantBoxes) || cantBoxes < 1)
            {
                Menu.CambiarColor(ConsoleColor.Red);
                Console.WriteLine("La cantidad ingresada es inválida, vuelva a intentarlo...\n");
                Menu.ResetearColor();
                Console.Write("\nIngrese cuantas boxes desea agregar: ");
            }

            try
            {
                LogicaPC.AgregarBoxes(cantBoxes);
                Menu.CambiarColor(ConsoleColor.Yellow);
                Console.WriteLine("Las boxes fueron agregadas");
            }
            catch (NoExisteBoxException e)
            {
                Menu.CambiarColor(ConsoleColor.Red);
                Console.WriteLine(e.Message);
            }

            Menu.EspereUnaTecla();
        }
示例#2
0
        /// <summary>
        /// Resetea y elimina toda la informacion cargada en la box
        /// </summary>
        static void ResetearBox()
        {
            Menu.HeaderPrincipal();
            int nroBox = ValidarBox("Ingrese un nro de box");

            try
            {
                Box box = LogicaPC.ObtenerBox(nroBox);

                if (Validaciones.ValidarSoN("Desea resetear la box"))
                {
                    LogicaPC.ResetearBox(box);
                    Menu.CambiarColor(ConsoleColor.Yellow);
                    Console.WriteLine("La box ha sido reseteada");
                }
                else
                {
                    Menu.CambiarColor(ConsoleColor.Red);
                    Console.WriteLine("No se ha reseteado la box");
                }
            }
            catch (NoExisteBoxException e)
            {
                Menu.CambiarColor(ConsoleColor.Red);
                Console.WriteLine(e.Message);
            }

            Menu.EspereUnaTecla();
        }
示例#3
0
        static string ReportePokedex()
        {
            StringBuilder sb = new StringBuilder();

            //Concatenando la informacion
            sb.AppendLine(Menu.LineaFormateada(100, '-'));
            sb.AppendFormat("{0,60}", "INFORME DE POKEDEX\n");
            sb.AppendLine(Menu.LineaFormateada(100, '-'));
            sb.AppendLine();
            sb.AppendFormat("{0}Porcentaje de la pokedex completada: {1}%\n", Menu.Identar(3), LogicaPC.PorcentajeDexCompletada());
            sb.AppendFormat("{0}Cantidad de pokemones atrapados: {1}\n", Menu.Identar(3), LogicaPC.TotalPokemonCapturados() - LogicaPC.CantHuevosEncontrados());
            sb.AppendFormat("{0}Cantidad de huevos obtenidos: {1}\n", Menu.Identar(3), LogicaPC.CantHuevosEncontrados());
            sb.AppendFormat("{0}Cantidad de pokemones intercambiados: {1}\n", Menu.Identar(3), LogicaPC.CantPokemonesIntercambiados());
            sb.AppendFormat("{0}Cantidad de pokemones de LVL (100): {1}\n", Menu.Identar(3), LogicaPC.CantPokemonesPorNivel(100, 100));
            sb.AppendFormat("{0}Nivel promedio de captura: {1}\n", Menu.Identar(3), LogicaPC.NivelPromedioCapturados());
            sb.AppendFormat("{0}Nro dex más capturado: #{1}\n", Menu.Identar(3), LogicaPC.PokemonMasCapturado());

            sb.AppendLine(LineaSeparacion());
            #region Capturas por distintos parámetros
            sb.AppendLine(InformeCapturasPorTipo());
            sb.AppendLine(InformeCapturasPorPokebola());
            sb.AppendLine(InformeCapturasPorGenero());
            #endregion

            sb.AppendLine(LineaSeparacion());
            sb.AppendLine(InformeLegendarios());

            sb.AppendLine(LineaSeparacion());
            sb.AppendLine(InformeMasterBall());

            return(sb.ToString());
        }
示例#4
0
        public static void Iniciar()
        {
            LogicaPC.IniciarPC();

            bool seguirEnMenu = true;

            do
            {
                Menu.HeaderPrincipal();
                Menu.BannerMenu("Menu PC");
                OpcionesMenu();

                switch (ValidarIngresoUsuario())
                {
                case OpcionesMenuPC.Boxes:
                    MenuBoxes.Iniciar();
                    break;

                case OpcionesMenuPC.Mail:
                    EnviarMail();
                    break;

                case OpcionesMenuPC.Informe:
                    MenuInforme.Iniciar();
                    break;

                case OpcionesMenuPC.Salir:
                    #region Salir del programa
                    if (Validaciones.ValidarSoN("Desea salir del programa?"))
                    {
                        seguirEnMenu = false;
                        Thread.Sleep(1500);
                        Environment.Exit(0);
                    }
                    #endregion
                    break;

                default:
                    break;
                }
            } while (seguirEnMenu);
        }
示例#5
0
        static string InformeMasterBall()
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("{0}MASTERBALL: \n", Menu.Identar(3));
            sb.AppendFormat("{0}{1}\n", Menu.Identar(3), Menu.LineaFormateada(12, '-'));

            if (LogicaPC.YaExistePokemonConMasterBall())
            {
                Pokemon pokemon = LogicaPC.PokemonAtrapadoConMasterball();
                sb.AppendFormat("{0}[NroDex: #{1}, Nombre: {2}, Nivel: {3}]", Menu.Identar(5), pokemon.NroDex, pokemon.Nombre, pokemon.Nivel);
            }
            else
            {
                sb.AppendFormat("{0}No se ha capturado pokemon con la masterball", Menu.Identar(5));
            }


            return(sb.ToString());
        }
示例#6
0
        /// <summary>
        /// Intercambia la posicion de dos boxes
        /// </summary>
        static void IntercambiarBoxes()
        {
            Menu.HeaderPrincipal();

            try
            {
                Box box1 = LogicaPC.ObtenerBox(ValidarBox("Ingrese la primera box"));
                Box box2 = LogicaPC.ObtenerBox(ValidarBox("Ingrese la segunda box"));

                LogicaPC.IntercambiarBoxes(box1, box2);
                Menu.CambiarColor(ConsoleColor.Yellow);
                Console.WriteLine("Las boxes fueron intercambiadas");
            }
            catch (NoExisteBoxException e)
            {
                Menu.CambiarColor(ConsoleColor.Red);
                Console.WriteLine(e.Message);
            }

            Menu.EspereUnaTecla();
        }
示例#7
0
        static string InformeLegendarios()
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("{0}POKEMONES LEGENDARIOS: \n", Menu.Identar(3));
            sb.AppendFormat("{0}{1}\n", Menu.Identar(3), Menu.LineaFormateada(25, '-'));

            #region Mostrando los legendarios capturados
            List <Pokemon> legendariosCapturados = LogicaPC.LegendariosCapturados();
            if (legendariosCapturados.Count != 0)
            {
                foreach (Pokemon pokemon in legendariosCapturados)
                {
                    sb.AppendFormat("{0}[NroDex: #{1}, Nombre: {2}, Nivel: {3}]\n", Menu.Identar(5), pokemon.NroDex, pokemon.Nombre, pokemon.Nivel);
                }
            }
            else
            {
                sb.AppendFormat("{0}No se han capturado legendarios por el momento\n", Menu.Identar(5));
            }
            #endregion

            return(sb.ToString());
        }
示例#8
0
        static string InformeCapturasPorGenero()
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("{0}CAPTURAS POR GENERO: \n", Menu.Identar(3));
            sb.AppendFormat("{0}{1}\n", Menu.Identar(3), Menu.LineaFormateada(21, '-'));
            foreach (int genero in Enum.GetValues(typeof(Genero)))
            {
                sb.AppendFormat("{0}Pokemones atrapados con género '{1}': {2}\n", Menu.Identar(5), Enum.GetName(typeof(Genero), genero), LogicaPC.CantPokemonesPorGenero((Genero)genero));
            }

            return(sb.ToString());
        }
示例#9
0
        static string InformeCapturasPorPokebola()
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("{0}CAPTURAS POR POKEBOLA: \n", Menu.Identar(3));
            sb.AppendFormat("{0}{1}\n", Menu.Identar(3), Menu.LineaFormateada(21, '-'));
            foreach (int pokebola in Enum.GetValues(typeof(Pokebola)))
            {
                if (pokebola != 0)
                {
                    sb.AppendFormat("{0}Pokemones atrapados con una '{1}': {2}\n", Menu.Identar(5), Enum.GetName(typeof(Pokebola), pokebola), LogicaPC.CantPokemonesPorPokebola((Pokebola)pokebola));
                }
            }

            return(sb.ToString());
        }
示例#10
0
        static string InformeCapturasPorTipo()
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("{0}CAPTURAS POR TIPO: \n", Menu.Identar(3));
            sb.AppendFormat("{0}{1}\n", Menu.Identar(3), Menu.LineaFormateada(20, '-'));
            foreach (int tipoPoke in Enum.GetValues(typeof(Tipo)))
            {
                if (tipoPoke != 0)
                {
                    sb.AppendFormat("{0}Pokemones atrapados tipo '{1}': {2}\n", Menu.Identar(5), Enum.GetName(typeof(Tipo), tipoPoke), LogicaPC.CantPokemonesPorTipo((Tipo)tipoPoke));
                }
            }

            return(sb.ToString());
        }