(options, level, session, team)
| 42 | } |
| 43 | |
| 44 | constructor (options, level, session, team) { |
| 45 | super(options) |
| 46 | let left, left1 |
| 47 | this.level = level |
| 48 | this.session = session |
| 49 | this.team = team |
| 50 | this.otherTeam = this.team === 'ogres' ? 'humans' : 'ogres' |
| 51 | if (isCodeCombat) { |
| 52 | if (this.level.isType('ladder')) { this.otherTeam = 'humans' } |
| 53 | } |
| 54 | this.wizardType = ThangType.loadUniversalWizard() |
| 55 | this.startLoadingChallengersMaybe() |
| 56 | this.levelID = this.level.get('slug') || this.level.id |
| 57 | this.language = (left = (left1 = this.session?.get('codeLanguage')) != null ? left1 : me.get('aceConfig')?.language) != null ? left : 'python' |
| 58 | this.languages = [ |
| 59 | { id: 'python', name: 'Python' }, |
| 60 | { id: 'javascript', name: 'JavaScript' }, |
| 61 | { id: 'coffeescript', name: 'CoffeeScript' }, |
| 62 | { id: 'lua', name: 'Lua' }, |
| 63 | { id: 'cpp', name: 'C++' }, |
| 64 | { id: 'java', name: 'Java (Experimental)' } |
| 65 | ] |
| 66 | this.myName = me.get('name') || 'Newcomer' |
| 67 | |
| 68 | const teams = [] |
| 69 | for (const t of teamDataFromLevel(this.level)) { teams[t.id] = t } |
| 70 | this.teamColor = teams[this.team].primaryColor |
| 71 | this.teamBackgroundColor = teams[this.team].bgColor |
| 72 | this.opponentTeamColor = teams[this.otherTeam].primaryColor |
| 73 | this.opponentTeamBackgroundColor = teams[this.otherTeam].bgColor |
| 74 | } |
| 75 | |
| 76 | updateLanguage () { |
| 77 | let left |
nothing calls this directly
no test coverage detected