2,875
edits
No edit summary |
No edit summary |
||
Line 96: | Line 96: | ||
local courseSlots = {} | local courseSlots = {} | ||
for _, v in obstacles do | for _, v in pairs(obstacles) do | ||
local currObstacle = getObstacle(v) | local currObstacle = getObstacle(v) | ||
if currObstacle then | if currObstacle then | ||
Line 113: | Line 113: | ||
local courseItemCosts = {} | local courseItemCosts = {} | ||
for _, course in courseObstacles do | for _, course in pairs(courseObstacles) do | ||
for skill, level in pairs(course.LevelRequirements) do | |||
addHighestLevelRequirement(courseLevelRequirements, skill, level) | |||
end | |||
for item, amount in pairs(course.ItemCosts) do | |||
concatItemRequirements(courseItemCosts, item, amount) | |||
end | |||
end | end | ||
return { | |||
courseLevelRequirements, | |||
courseItemCosts | |||
} | |||
end | end | ||
Line 132: | Line 143: | ||
end | end | ||
p.calculateCourse(obstacleNames, true) | local courseRequirements = p.calculateCourse(obstacleNames, true) | ||
return | return Debug.toString(courseRequirements) | ||
end | end | ||
edits