示例#1
0
        private static Direction ReadDirection(IIOManager ioManager)
        {
            ConsoleKeyInfo key;

            do
            {
                key = ioManager.ReadKey();
            } while (
                key.Key != ConsoleKey.LeftArrow &&
                key.Key != ConsoleKey.UpArrow &&
                key.Key != ConsoleKey.RightArrow &&
                key.Key != ConsoleKey.DownArrow);
            return(GetDirection(key.Key));
        }
示例#2
0
 private static Direction ReadDirection(IIOManager ioManager)
 {
     ConsoleKeyInfo key;
     do
     {
         key = ioManager.ReadKey();
     } while (
         key.Key != ConsoleKey.LeftArrow &&
         key.Key != ConsoleKey.UpArrow &&
         key.Key != ConsoleKey.RightArrow &&
         key.Key != ConsoleKey.DownArrow);
     return GetDirection(key.Key);
 }