// 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); }
// 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); }
// 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)); }