|
|
|
@ -821,11 +821,9 @@ elab "MakeGame" : command => do
|
|
|
|
-- Calculate world dependency graph `game.worlds`
|
|
|
|
-- Calculate world dependency graph `game.worlds`
|
|
|
|
for (dependentWorldId, _dependentWorld) in game.worlds.nodes.toArray do
|
|
|
|
for (dependentWorldId, _dependentWorld) in game.worlds.nodes.toArray do
|
|
|
|
let mut dependsOnWorlds : HashSet Name := {}
|
|
|
|
let mut dependsOnWorlds : HashSet Name := {}
|
|
|
|
|
|
|
|
-- Adding manual paths that were specified via the `Path` command.
|
|
|
|
for (sourceId, targetId) in game.worlds.edges do
|
|
|
|
for (sourceId, targetId) in game.worlds.edges do
|
|
|
|
|
|
|
|
|
|
|
|
-- Adding manual paths that were specified via the `Path` command.
|
|
|
|
|
|
|
|
if targetId = dependentWorldId then
|
|
|
|
if targetId = dependentWorldId then
|
|
|
|
logInfo m!"Adding manual path: {sourceId} → {targetId}"
|
|
|
|
|
|
|
|
dependsOnWorlds := dependsOnWorlds.insert sourceId
|
|
|
|
dependsOnWorlds := dependsOnWorlds.insert sourceId
|
|
|
|
|
|
|
|
|
|
|
|
for usedItem in usedItemsInWorld.find! dependentWorldId do
|
|
|
|
for usedItem in usedItemsInWorld.find! dependentWorldId do
|
|
|
|
@ -853,7 +851,7 @@ elab "MakeGame" : command => do
|
|
|
|
for dep in dependencies do
|
|
|
|
for dep in dependencies do
|
|
|
|
match dependencyReasons.find? (world, dep) with
|
|
|
|
match dependencyReasons.find? (world, dep) with
|
|
|
|
| none =>
|
|
|
|
| none =>
|
|
|
|
msg := msg ++ m!"\n· '{dep}': no reason found"
|
|
|
|
msg := msg ++ m!"\n· '{dep}': no reason found (manually added?)"
|
|
|
|
| some items =>
|
|
|
|
| some items =>
|
|
|
|
msg := msg ++ m!"\n· '{dep}' because of:\n {items.toList}"
|
|
|
|
msg := msg ++ m!"\n· '{dep}' because of:\n {items.toList}"
|
|
|
|
logInfo msg
|
|
|
|
logInfo msg
|
|
|
|
@ -877,8 +875,6 @@ elab "MakeGame" : command => do
|
|
|
|
pure {game with worlds := {game.worlds with
|
|
|
|
pure {game with worlds := {game.worlds with
|
|
|
|
edges := game.worlds.edges.append (worldIds.toArray.map fun wid => (wid, dependentWorldId))}}
|
|
|
|
edges := game.worlds.edges.append (worldIds.toArray.map fun wid => (wid, dependentWorldId))}}
|
|
|
|
|
|
|
|
|
|
|
|
-- logInfo m!"Dependencies: {worldDependsOnWorlds.toArray.map fun (a,b) => (a,b.toArray)}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Apparently we need to reload `game` to get the changes to `game.worlds` we just made
|
|
|
|
-- Apparently we need to reload `game` to get the changes to `game.worlds` we just made
|
|
|
|
let game ← getCurGame
|
|
|
|
let game ← getCurGame
|
|
|
|
|
|
|
|
|
|
|
|
|