MCPcopy Create free account
hub / github.com/codecombat/codecombat / visit

Method visit

app/models/Level.js:335–346  ·  view source on GitHub ↗
(system)

Source from the content-addressed store, hash-verified

333 sortSystems (levelSystems, systemModels) {
334 const [sorted, originalsSeen] = Array.from([[], {}])
335 const visit = function (system) {
336 if (system.original in originalsSeen) { return }
337 const systemModel = _.find(systemModels, { original: system.original })
338 if (!systemModel) { return console.error('Couldn\'t find model for original', system.original, 'from', systemModels) }
339 for (const d of Array.from(systemModel.dependencies || [])) {
340 const system2 = _.find(levelSystems, { original: d.original })
341 visit(system2)
342 }
343 // console.log 'sorted systems adding', systemModel.name
344 sorted.push({ model: systemModel, config: $.extend(true, {}, system.config) })
345 originalsSeen[system.original] = true
346 }
347 for (const system of Array.from(levelSystems != null ? levelSystems : [])) { visit(system) }
348 return sorted
349 }

Callers

nothing calls this directly

Calls 1

errorMethod · 0.45

Tested by

no test coverage detected