     visit system for system in levelSystems
     sorted
 
-  sortThangComponents: (thangs, levelComponents) ->
+  sortThangComponents: (thangs, levelComponents, parentType) ->
     # Here we have to sort the Components by their dependencies.
     # It's a bit tricky though, because we don't have either soft dependencies or priority levels.
     # Example: Programmable must come last, since it has to override any Component-provided methods that any other Component might have created. Can't enumerate all soft dependencies.


    # Figure out Components
    o.levelComponents = _.cloneDeep (lc.attributes for lc in supermodel.getModels LevelComponent)
    @sortThangComponents o.thangs, o.levelComponents
    @fillInDefaultComponentConfiguration o.thangs, o.levelComponents

    # Figure out Systems


    # Figure out ThangTypes' Components
    o.thangTypes = (original: tt.get('original'), name: tt.get('name'), components: $.extend(true, [], tt.get('components')) for tt in supermodel.getModels ThangType)
    @sortThangComponents o.thangTypes, o.levelComponents, 'ThangType'
    @fillInDefaultComponentConfiguration o.thangTypes, o.levelComponents

    o
