public void Remove(PhysicalObject po) { int squareX = (int)(po.Position.X - _lowX) / Square.SquareSize; int squareZ = (int)(po.Position.Z - _lowZ) / Square.SquareSize; InformNearby(po, new ToClient.DropPhysicalObject(po)); _square[squareX, squareZ].Remove(po); PhysicalObjects.Remove(po.ObjectInstanceId); if (po is MobileAvatar) { Mobiles.Remove((MobileAvatar)po); } _log.Info("Removed " + po.GetType() + " " + po.ObjectInstanceId + " from the world."); }
public void RemovePhysicalObject(PhysicalObject Object) { if (PhysicalObjects.Contains(Object)) { PhysicalObjects.Remove(Object); if (MainStage.Children.Contains(Object.ObjectImage)) { MainStage.Children.Remove(Object.ObjectImage); if (Object.ColliderHandler != null) { MainStage.Children.Remove(Object.ColliderHandler.BoxCollider); ManagerCollision.RemoveCollider(Object.ColliderHandler); } } } }