mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-31 07:12:49 -04:00
Forget old goals.
This commit is contained in:
parent
f82483b905
commit
081274579b
1 changed files with 5 additions and 7 deletions
|
@ -64,7 +64,7 @@ module.exports = class Simulator
|
|||
|
||||
setupGoalManager: ->
|
||||
@god.goalManager = new GoalManager @world
|
||||
@god.goalManager.goals = @fetchGoalsFromWorldNoteChain()
|
||||
@god.goalManager.goals = @god.level.goals
|
||||
@god.goalManager.goalStates = @manuallyGenerateGoalStates()
|
||||
|
||||
commenceSimulationAndSetupCallback: ->
|
||||
|
@ -114,7 +114,7 @@ module.exports = class Simulator
|
|||
sessions: []
|
||||
|
||||
for session in @task.getSessions()
|
||||
|
||||
|
||||
sessionResult =
|
||||
sessionID: session.sessionID
|
||||
submitDate: session.submitDate
|
||||
|
@ -142,8 +142,6 @@ module.exports = class Simulator
|
|||
else
|
||||
return 1
|
||||
|
||||
fetchGoalsFromWorldNoteChain: -> return @god.goalManager.world.scripts[0].noteChain[0].goals.add
|
||||
|
||||
manuallyGenerateGoalStates: ->
|
||||
goalStates =
|
||||
"destroy-humans":
|
||||
|
@ -195,7 +193,7 @@ module.exports = class Simulator
|
|||
spellKeyComponents[0] = _.string.slugify spellKeyComponents[0]
|
||||
spellKey = spellKeyComponents.join '/'
|
||||
spellKey
|
||||
|
||||
|
||||
|
||||
createSpellAndAssignName: (spellKey, spellName) ->
|
||||
@spells[spellKey] ?= {}
|
||||
|
@ -267,10 +265,10 @@ class SimulationTask
|
|||
fullSpellName = [thangName,spellName].join '/'
|
||||
if _.contains(teamSpells, fullSpellName)
|
||||
teamCode[fullSpellName]=spell
|
||||
|
||||
|
||||
_.merge spellKeyToSourceMap, teamCode
|
||||
commonSpells = session.teamSpells["common"]
|
||||
_.merge spellKeyToSourceMap, _.pick(session.code, commonSpells) if commonSpells?
|
||||
|
||||
|
||||
|
||||
spellKeyToSourceMap
|
||||
|
|
Loading…
Add table
Reference in a new issue