예제 #1
0
 /// <summary>
 /// What happens when the user types "look" as the command word.
 /// </summary>
 /// <param name="parts">Command Parts.</param>
 private static void ProcessLookCommand(string[] parts)
 {
     // If you just type "look" then LookAround()
     if (parts.Length == 1)
     {
         Console.WriteLine(CurrentArea.LookAround());
     }
     else
     {
         // try to find the thing that the user is looking at.
         try
         {
             // if it is there, print the appropriate description.
             Console.WriteLine(CurrentArea.LookAt(parts[1]));
         }
         catch (WorldException e)
         {
             // otherwise, print an appropriate error message.
             PrintLineDanger(e.Message);
         }
     }
 }