Exemplo n.º 1
0
        private static void control(IFighter fighter)
        {
            Debug.WriteLine("Commands are: \n\"stop\": for stopping the bot");

            string command = "";

            while (command != "stop")
            {
                command = Console.ReadLine();
                if (command.Contains("write:"))
                {
                    fighter.addQueue(command.Substring(6).Trim());
                }
                else if (command == "forfeit")
                {
                    fighter.addQueue("/forfeit");
                }
                else if (command == "stop")
                {
                    Debug.WriteLine("Stop will be initiated!");
                }
                else
                {
                    Console.WriteLine("Command not recognized!");
                }
            }

            fighter.stop();
        }
Exemplo n.º 2
0
        private static void control(IFighter fighter)
        {
            Debug.WriteLine("Commands are: \n\"stop\": for stopping the bot");

            string command = Console.ReadLine();

            while (command != "stop")
            {
                command = Console.ReadLine();
                if (command.Contains("write:"))
                {
                    fighter.addQueue(command.Substring(6).Trim());
                }
                else if (command == "forfeit")
                {
                    fighter.addQueue("/forfeit");
                }
                else if (command == "stop")
                {
                    Debug.WriteLine("Stop will be initiated!");
                }
                else
                {
                    Console.WriteLine("Command not recognized!");
                }
            }

            fighter.stop();
        }