/// <summary> /// Removes the specified house. /// </summary> /// <param name="house">The shop, which must not be <c>null</c>.</param> public override void Remove(House house) { Debug.Assert(house != null, "House must not be null."); lock ( locker ) { TShock.Regions.DeleteRegion($"__House<>{house.OwnerName}<>{house.Name}"); NonQuery("DELETE FROM Houses WHERE OwnerName = @0 AND Name = @1 AND WorldId = @2", house.OwnerName, house.Name, Main.worldID); Houses.Remove(house); foreach (var shop in Shops.Where(s => house.Rectangle.Contains(s.Rectangle))) { Remove(shop); } } }
public void RemoveHouse(House house) { Houses.Remove(house); }