Exemple #1
0
        /*protected Point PlayersTurn()
         * {
         *  ConsoleKeyInfo theKey = Console.ReadKey(true);
         *
         *  if (theKey.Key == ConsoleKey.UpArrow)
         *  {
         *      return Direction.Up;
         *  }
         *  if (theKey.Key == ConsoleKey.DownArrow)
         *  {
         *      return Direction.Down;
         *  }
         *  if (theKey.Key == ConsoleKey.LeftArrow)
         *  {
         *      return Direction.Left;
         *  }
         *  if (theKey.Key == ConsoleKey.RightArrow)
         *  {
         *      return Direction.Right;
         *  }
         *  if (theKey.Key == ConsoleKey.A)
         *  {
         *      return Direction.Pass;
         *  }
         *  return new Point();
         * }*/

        public bool Move(Keys theKeypress)
        {
            Point direction = PlayersTurn(theKeypress);

            if (direction != null)
            {
                return(theseus.Move(direction));
            }
            return(false);
        }
Exemple #2
0
 public bool AdjTilesValid(List <Point> pointList)
 {
     foreach (Point p in pointList)
     {
         try
         {
             theseus.Move(p);
         }
         catch (Exception)
         {
             return(false);
         }
     }
     return(true);
 }