1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
| var progressions = await progressionSystem.GetProgressionsAsync();
foreach (var kvp in progressions)
{
Debug.Log($"Progression {kvp.Key}");
Debug.Log($"Is Unlocked? {kvp.Value.Unlocked}");
if (!kvp.Value.Unlocked)
{
Debug.Log("Unmet preconditions:");
PrintUnmetPreconditions(kvp.Value.UnmetPreconditions);
}
}
async void PrintUnmetPreconditions(IProgressionPreconditionsBlock block)
{
var progressions = await progressionSystem.GetProgressionsAsync();
foreach (var kvp in progressions)
{
Debug.Log($"Progression {kvp.Key}");
Debug.Log($"Is Unlocked? {kvp.Value.Unlocked}");
if (!kvp.Value.Unlocked)
{
Debug.Log("Unmet preconditions:");
PrintUnmetPreconditions(kvp.Value.UnmetPreconditions);
}
}
void PrintUnmetPreconditions(IProgressionPreconditionsBlock block)
{
Debug.Log($"Block Operator: {block.Operator}");
if (block.Direct != null)
{
Debug.Log("Direct");
Debug.Log($"Progressions: {string.Join(", ", block.Direct.Progressions)}");
Debug.Log($"Achievements: {string.Join(", ", block.Direct.Achievements)}");
Debug.Log($"Counts: {string.Join(", ", block.Direct.Counts.Select(kv => $"{kv.Key}: {kv.Value}"))}");
Debug.Log($"ItemsMin: {string.Join(", ", block.Direct.ItemsMin.Select(kv => $"{kv.Key}: {kv.Value}"))}");
Debug.Log($"ItemsMax: {string.Join(", ", block.Direct.ItemsMax.Select(kv => $"{kv.Key}: {kv.Value}"))}");
Debug.Log($"StatsMin: {string.Join(", ", block.Direct.StatsMin.Select(kv => $"{kv.Key}: {kv.Value}"))}");
Debug.Log($"StatsMax: {string.Join(", ", block.Direct.StatsMax.Select(kv => $"{kv.Key}: {kv.Value}"))}");
Debug.Log($"EnergyMin: {string.Join(", ", block.Direct.EnergyMin.Select(kv => $"{kv.Key}: {kv.Value}"))}");
Debug.Log($"EnergyMax: {string.Join(", ", block.Direct.EnergyMax.Select(kv => $"{kv.Key}: {kv.Value}"))}");
Debug.Log($"CurrencyMin: {string.Join(", ", block.Direct.CurrencyMin.Select(kv => $"{kv.Key}: {kv.Value}"))}");
Debug.Log($"CurrencyMax: {string.Join(", ", block.Direct.CurrencyMax.Select(kv => $"{kv.Key}: {kv.Value}"))}");
}
if (block.Nested != null)
{
Debug.Log("Nested");
PrintUnmetPreconditions(block.Nested);
}
}
}
|