public void RemoveObject(SceneObjectId id)
 {
     Objects.Remove(id);
     LoadableObjects.Remove(id);
     MovableObjects.Remove(id);
     CollidableObjects.Remove(id);
     UpdateableObjects.Remove(id);
     DrawableObjects.Remove(id);
 }
        public void AddObject(ICutlassSceneObject o)
        {
            SceneObjectId sceneObjectId;

            lock (_SceneObjectIdLock)
            {
                sceneObjectId = _NextSceneObjectId++;
            }

            Objects.Add(sceneObjectId, o);

            //Add object to necessary lists.
            ICutlassLoadable loadable = o as ICutlassLoadable;

            if (loadable != null)
            {
                LoadableObjects.Add(sceneObjectId, loadable);
            }

            ICutlassMovable movable = o as ICutlassMovable;

            if (movable != null)
            {
                MovableObjects.Add(sceneObjectId, movable);
            }

            ICutlassCollidable collidable = o as ICutlassCollidable;

            if (collidable != null)
            {
                CollidableObjects.Add(sceneObjectId, collidable);
            }

            ICutlassUpdateable updateable = o as ICutlassUpdateable;

            if (updateable != null)
            {
                UpdateableObjects.Add(sceneObjectId, updateable);
            }

            ICutlassDrawable drawable = o as ICutlassDrawable;

            if (drawable != null)
            {
                DrawableObjects.Add(sceneObjectId, drawable);
            }

            //If this scene has already been initialized, initialize this object now.
            if (_Initialized && loadable != null)
            {
                loadable.LoadContent();
            }
        }