Beispiel #1
0
 // Same as GetRecipient, but for NPCs. Used in combat, trades, conversation.
 public static NPC GetTarget(int room, string a, MapBuild WorldMap)
 {
     foreach (var i in WorldMap.Rooms[room].NPCs)
     {
         if (FuzzyEquals(i.Actual.Name, a))
         {
             return(i.Actual);
         }
     }
     return(null);
 }
Beispiel #2
0
 // Utility func for finding if a room has Containers
 public static bool HasContainers(User sender, MapBuild WorldMap)
 {
     return(WorldMap.Rooms[GetCurrentRoomId(sender, WorldMap)].Containers.Count != 0);
 }
Beispiel #3
0
 // Utility func for getting the user's current room ID
 public static int GetCurrentRoomId(User sender, MapBuild WorldMap)
 {
     return(WorldMap.Rooms.FindIndex(a => a.Id == sender.CurrRoomId));
 }