mirror of
https://github.com/cave-story-randomizer/cave-story-randomizer
synced 2024-12-25 14:37:05 +00:00
regions get logged in proper order
This commit is contained in:
parent
2189bee2f5
commit
e1811934d4
|
@ -4,6 +4,8 @@ function C:new(worldGraph, name)
|
|||
self.locations = {}
|
||||
self.world = worldGraph
|
||||
self.name = name
|
||||
self.order = worldGraph.order
|
||||
worldGraph.order = worldGraph.order + 1
|
||||
end
|
||||
|
||||
function C:canAccess(items)
|
||||
|
|
|
@ -409,6 +409,7 @@ local worldGraph = Class:extend()
|
|||
|
||||
function worldGraph:new(items)
|
||||
self.items = items
|
||||
self.order = 0
|
||||
|
||||
self.regions = {
|
||||
firstCave = firstCave(self),
|
||||
|
@ -550,7 +551,15 @@ function worldGraph.locationsArray(locations)
|
|||
end
|
||||
|
||||
function worldGraph:logLocations()
|
||||
for k,r in pairs(self.regions) do
|
||||
local array = {}
|
||||
for k,v in pairs(self.regions) do
|
||||
table.insert(array, v)
|
||||
end
|
||||
local function sort(a,b)
|
||||
return a.order < b.order
|
||||
end
|
||||
|
||||
for k,r in ipairs(_.sort(array,sort)) do
|
||||
if next(r.locations) then
|
||||
logSpoiler("")
|
||||
logSpoiler("Region: " .. r.name)
|
||||
|
|
|
@ -37,6 +37,7 @@ function C:new()
|
|||
self.obj = ""
|
||||
self.sharecode = ""
|
||||
self.mychar = ""
|
||||
self.spawn = ""
|
||||
end
|
||||
|
||||
function C:setPath(path)
|
||||
|
|
Loading…
Reference in a new issue