Пример #1
0
        private bool PlayerMove()
        {
            Console.WriteLine("What are you going to do next?");
            ConsoleBattleInfo.ShowAvailableCommandsOnConsole();

            Command chosenCommand   = (Command)Enum.Parse(typeof(Command), Console.ReadLine() ?? "1");
            bool    keepBattleGoing = (bool)Commands[chosenCommand].DynamicInvoke();

            return(keepBattleGoing);
        }
        public int KeepPlayerChoosingItem(int limitOfItemStacksInTheInventory)
        {
            int chosenItem = -1;

            while (chosenItem <= -1 || chosenItem > limitOfItemStacksInTheInventory)
            {
                ConsoleBattleInfo.WriteAllAvailableItemsOnConsole(Player);
                chosenItem = ConsoleUtils.GetPlayerChosenIndex(Console.ReadLine());
            }

            return(chosenItem);
        }
        public int KeepPlayerChoosingMove(int movesLimit)
        {
            int chosenMove = -1;

            IPokemon currentPokemon = Player.GetCurrentPokemon();

            while (chosenMove <= -1 || chosenMove > movesLimit)
            {
                ConsoleBattleInfo.WriteAllAvailableAttacksOnConsole(currentPokemon);
                chosenMove = ConsoleUtils.GetPlayerChosenIndex(Console.ReadLine());
            }

            return(chosenMove);
        }