Beispiel #1
0
 public void LookAt(string targetName = "")
 {
     if (targetName == "")
     {
         CurrentRoom.ExamineRoom();
     }
     else
     {
         if (CurrentRoom.GetAllEntities().TryGet(targetName, out Entity entity))
         {
             Game.WriteLine(entity.Description);
         }
         else if (CurrentRoom.Connections.TryGetValue(targetName, out Door door))
         {
             Game.WriteLine(door.Description);
         }
         else if (Inventory.TryGet(targetName, out Item item))
         {
             Game.WriteLine(item.Description);
         }
         else
         {
             Say("I can't see that anywhere.");
         }
     }
 }