()
| 497 | } |
| 498 | |
| 499 | getHeroClasses () { |
| 500 | const idsToSlugs = _.invert(ThangTypeConstants.heroes) |
| 501 | const myHeroSlugs = (this.heroes().map((id) => idsToSlugs[id])) |
| 502 | const myHeroClasses = [] |
| 503 | for (const heroClass in ThangTypeConstants.heroClasses) { const heroSlugs = ThangTypeConstants.heroClasses[heroClass]; if (_.intersection(myHeroSlugs, heroSlugs).length) { myHeroClasses.push(heroClass) } } |
| 504 | return myHeroClasses |
| 505 | } |
| 506 | |
| 507 | validate () { |
| 508 | const errors = super.validate() |