src/world.js
function (entity, just) {
            _.each(
                systems,
                function (system) {
                    if (_.has(system, 'destroy')) {
                        _.each(system.destroy, function (func, id) {
                            if (entity.has(id)){
                                // Only remove from tracking systems.
                                if (!_.isUndefined(just)) {
                                    if (id !== just) {
                                        return;
                                    }
                                }
                                // Perform the remove.
                                func(entity);
                            }
                        });
                    }
                }
            );
        }
function (entity, just) {
            _.each(
                systems,
                function (system) {
                    if (_.has(system, 'destroy')) {
                        _.each(system.destroy, function (func, id) {
                            if (entity.has(id)){
                                // Only remove from tracking systems.
                                if (!_.isUndefined(just)) {
                                    if (id !== just) {
                                        return;
                                    }
                                }
                                // Perform the remove.
                                func(entity);
                            }
                        });
                    }
                }
            );
        }
function ( entity , just ) { _ . each ( systems , function ( system ) { if ( _ . has ( system , 'destroy' ) ) { _ . each ( system . destroy , function ( func , id ) { if ( entity . has ( id ) ) { // Only remove from tracking systems. if ( ! _ . isUndefined ( just ) ) { if ( id !== just ) { return ; } } // Perform the remove. func ( entity ) ; } } ) ; } } ) ; }
Destroys an entity in all registered systems. If 'just' is given, just systems that deal with that component destroy the entity rather than all.
Destroys an entity in all registered systems . If just is given just systems that deal with that component destroy the entity rather than all .