codecombat/app/lib/scripts/GoalsScriptModule.coffee

35 lines
727 B
CoffeeScript
Raw Normal View History

2014-01-03 13:32:13 -05:00
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