mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 08:08:15 -05:00
35 lines
No EOL
727 B
CoffeeScript
35 lines
No EOL
727 B
CoffeeScript
ScriptModule = require './ScriptModule'
|
|
|
|
module.exports = class GoalsScriptModule extends ScriptModule
|
|
@neededFor: (noteGroup) ->
|
|
return noteGroup.goals?
|
|
|
|
startNotes: ->
|
|
notes = []
|
|
notes.push(@addNote()) if @noteGroup.goals.add?
|
|
notes.push(@removeNote()) if @noteGroup.goals.remove?
|
|
return notes
|
|
|
|
endNotes: ->
|
|
return []
|
|
|
|
skipNotes: ->
|
|
return @startNotes()
|
|
|
|
addNote: ->
|
|
note =
|
|
channel: 'level-add-goals'
|
|
event:
|
|
goals: @noteGroup.goals.add
|
|
worldName: @view.world.name
|
|
return note
|
|
|
|
removeNote: ->
|
|
note =
|
|
channel: 'level-remove-goals'
|
|
event:
|
|
goals: @noteGroup.goals.remove
|
|
worldName: @view.world.name
|
|
return note
|
|
|
|
|