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

Method requiredRawAnimations

app/models/ThangType.js:274–293  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

272 }
273
274 requiredRawAnimations () {
275 const required = []
276 const object = this.get('actions')
277 for (const name in object) {
278 const action = object[name]
279 if (name === 'portrait') { continue }
280 const allActions = [action].concat(_.values((action.relatedActions != null ? action.relatedActions : {})))
281 for (const a of Array.from(allActions)) {
282 if (a.animation) {
283 const scale = name === 'portrait' ? a.scale || 1 : a.scale || this.get('scale') || 1
284 const animation = { animation: a.animation, scale }
285 animation.portrait = name === 'portrait'
286 if (!_.find(required, r => _.isEqual(r, animation))) {
287 required.push(animation)
288 }
289 }
290 }
291 }
292 return required
293 }
294
295 mapFrames (frames, frameOffset) {
296 if (!_.isString(frames)) { return frames } // don't accidentally do this again

Callers 1

addGeneralFramesMethod · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected