private static bool HasNoRoomOrOutOfBounds(this Map map, int x, int y) { if (x < 0 || x >= map.Width) { return(true); } if (y < 0 || y >= map.Height) { return(true); } return(!map.HasRoomAt(x, y)); }
public static bool TryGetRoomAt(this Map map, int x, int y, out IRoom room) { if (map == null) { throw new ArgumentNullException(nameof(map)); } if (map.HasRoomAt(x, y)) { room = map[x, y]; return(true); } room = default; return(false); }