Merge branch 'main' of https://homelab.tailf7f81b.ts.net/tschesky/AppleHillsProduction
This commit is contained in:
@@ -205,16 +205,36 @@ namespace PuzzleS
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Unlocks all initial steps (those with no dependencies).
|
||||
/// Unlocks all initial steps (those with no dependencies) and any steps whose dependencies are already met.
|
||||
/// </summary>
|
||||
private void UnlockInitialSteps()
|
||||
{
|
||||
// First, unlock all steps with no dependencies (initial steps)
|
||||
var initialSteps = PuzzleGraphUtility.FindInitialSteps(_runtimeDependencies);
|
||||
foreach (var step in initialSteps)
|
||||
{
|
||||
Debug.Log($"[Puzzles] Initial step unlocked: {step.stepId}");
|
||||
UnlockStep(step);
|
||||
}
|
||||
|
||||
// Keep trying to unlock steps as long as we're making progress
|
||||
bool madeProgress;
|
||||
do
|
||||
{
|
||||
madeProgress = false;
|
||||
|
||||
// Check all steps that haven't been unlocked yet
|
||||
foreach (var step in _runtimeDependencies.Keys.Where(s => !_unlockedSteps.Contains(s)))
|
||||
{
|
||||
// Check if all dependencies have been completed
|
||||
if (AreRuntimeDependenciesMet(step))
|
||||
{
|
||||
Debug.Log($"[Puzzles] Chain step unlocked: {step.stepId}");
|
||||
UnlockStep(step);
|
||||
madeProgress = true;
|
||||
}
|
||||
}
|
||||
} while (madeProgress);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user