This commit is contained in:
Ottermandias 2023-05-02 21:13:01 +02:00
parent c911977b5e
commit 4b1443ec93
2 changed files with 5 additions and 4 deletions

View file

@ -29,6 +29,8 @@ public class CollectionCache : IDisposable
public readonly MetaCache Meta;
public readonly Dictionary<IMod, SingleArray<ModConflicts>> _conflicts = new();
public bool Calculating;
public IEnumerable<SingleArray<ModConflicts>> AllConflicts
=> _conflicts.Values;

View file

@ -28,7 +28,6 @@ public class CollectionCacheManager : IDisposable
internal readonly MetaFileManager MetaFileManager;
public int Count { get; private set; }
public bool Calculating { get; private set; }
public IEnumerable<ModCollection> Active
=> _storage.Where(c => c.HasCache);
@ -117,10 +116,10 @@ public class CollectionCacheManager : IDisposable
private void FullRecalculation(ModCollection collection)
{
var cache = collection._cache;
if (cache == null || Calculating)
if (cache == null || cache.Calculating)
return;
Calculating = true;
cache.Calculating = true;
try
{
cache.ResolvedFiles.Clear();
@ -145,7 +144,7 @@ public class CollectionCacheManager : IDisposable
}
finally
{
Calculating = false;
cache.Calculating = false;
}
}