(supermodel, session, otherSession)
| 96 | } |
| 97 | |
| 98 | denormalize (supermodel, session, otherSession) { |
| 99 | let tt |
| 100 | const o = $.extend(true, {}, this.attributes) |
| 101 | if (o.thangs && (utils.isCodeCombat || this.isType('hero', 'hero-ladder', 'hero-coop', 'course', 'course-ladder', 'game-dev', 'web-dev'))) { |
| 102 | const thangTypesWithComponents = ((() => { |
| 103 | const result = [] |
| 104 | for (tt of Array.from(supermodel.getModels('ThangType'))) { |
| 105 | if (tt.get('components')) { |
| 106 | result.push(tt) |
| 107 | } |
| 108 | } |
| 109 | return result |
| 110 | })()) |
| 111 | const thangTypesByOriginal = _.indexBy(thangTypesWithComponents, tt => tt.get('original')) // Optimization |
| 112 | for (const levelThang of Array.from(o.thangs)) { |
| 113 | this.denormalizeThang(levelThang, supermodel, session, otherSession, thangTypesByOriginal) |
| 114 | } |
| 115 | } |
| 116 | return o |
| 117 | } |
| 118 | |
| 119 | denormalizeThang (levelThang, supermodel, session, otherSession, thangTypesByOriginal) { |
| 120 | let config, heroThangType, isHero, placeholderComponent, placeholders, placeholdersUsed, thangComponent |
no test coverage detected