예제 #1
0
        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.");
        }
예제 #2
0
        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);
                    }
                }
            }
        }