From f02f2968c78eeda3e9b02904fe634f317f57de05 Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Fri, 27 Oct 2017 12:40:29 +0200 Subject: [PATCH] linking system really fixed --- src/game-lib-system-linking.js | 40 +++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/src/game-lib-system-linking.js b/src/game-lib-system-linking.js index a283bbd..b5cdf17 100644 --- a/src/game-lib-system-linking.js +++ b/src/game-lib-system-linking.js @@ -390,29 +390,35 @@ GameLib.System.Linking.prototype.resolveDependencies = function(component) { this.resolved = []; - } else { + } + //else { - var keys = Object.keys(this.dependencies); + // var keys = Object.keys(this.dependencies); /** * And this is it - we need to check if the dependencies array contains any 'resolved' components - * If it does - resolve the dependencies of this newly 'resolved' component */ - this.resolved.map( - - function(component) { - - if (keys.indexOf(component.id) !== -1) { - /** - * We found a resolved component - which is a dependency for another component. - * Resolve the dependencies of this component - this is recursive and should be done carefully - */ - this.resolveDependencies(component); - } - - }.bind(this) - ); - } + // this.resolved = this.resolved.reduce( + // + // function(result, component) { + // + // if (keys.indexOf(component.id) !== -1) { + // /** + // * We found a resolved component - which is a dependency for another component. + // * Resolve the dependencies of this component - this is recursive and should be done carefully + // */ + // this.resolveDependencies(component); + // } else { + // result.push(component); + // } + // + // return result; + // + // }.bind(this), + // [] + // ); + //} };