dist/server-module/lance-gg.js
/**
     * Remove an object from the game world.
     *
     * @param {Object|String} objectId - the object or object ID
     */
Remove an object from the game world.
@param {Object|String} objectId - the object or object ID
Remove an object from the game world . @param { Object|String } objectId - the object or object ID
removeObjectFromWorld(objectId) {
        if (typeof objectId === 'object') objectId = objectId.id;
        let object = this.world.objects[objectId];
        if (!object) {
            throw new Error(`Game attempted to remove a game object which doesn't (or never did) exist, id=${objectId}`);
        }
        this.trace.info(() => `========== destroying object ${object.toString()} ==========`);
        if (typeof object.onRemoveFromWorld === 'function')
            object.onRemoveFromWorld(this);
        const groups = this.world.removeObject(objectId);
        this.emit('objectDestroyed', { object, groups });
    }
removeObjectFromWorld ( objectId ) { if ( typeof objectId === 'object' ) objectId = objectId . id ; let object = this . world . objects [ objectId ] ; if ( ! object ) { throw new Error ( ` ${ objectId } ` ) ; } this . trace . info ( ( ) => ` ${ object . toString ( ) } ` ) ; if ( typeof object . onRemoveFromWorld === 'function' ) object . onRemoveFromWorld ( this ) ; const groups = this . world . removeObject ( objectId ) ; this . emit ( 'objectDestroyed' , { object , groups } ) ; }
Remove an object from the game world.
Remove an object from the game world .