misc fixes
parent
53f4124fdb
commit
e6059a2f0a
|
@ -132,12 +132,21 @@ public class Filter
|
|||
|
||||
// breadth-first search
|
||||
// ignore excluded component edges
|
||||
foreach (var (componentId, edge) in current.AddEdges)
|
||||
foreach (var (componentId, archetype) in current.AddEdges)
|
||||
{
|
||||
if (!filter.Excluded.Contains(componentId))
|
||||
if (!Explored.Contains(archetype) && !filter.Excluded.Contains(componentId))
|
||||
{
|
||||
Explored.Add(edge);
|
||||
ArchetypeSearchQueue.Enqueue(edge);
|
||||
Explored.Add(archetype);
|
||||
ArchetypeSearchQueue.Enqueue(archetype);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var (componentId, archetype) in current.RemoveEdges)
|
||||
{
|
||||
if (!Explored.Contains(archetype))
|
||||
{
|
||||
Explored.Add(archetype);
|
||||
ArchetypeSearchQueue.Enqueue(archetype);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -220,7 +220,11 @@ namespace MoonTools.ECS
|
|||
}
|
||||
|
||||
archetype.AddEdges.Add(componentTypeId, nextArchetype);
|
||||
|
||||
if (!nextArchetype.RemoveEdges.ContainsKey(componentTypeId))
|
||||
{
|
||||
nextArchetype.RemoveEdges.Add(componentTypeId, archetype);
|
||||
}
|
||||
|
||||
return nextArchetype;
|
||||
}
|
||||
|
@ -246,7 +250,11 @@ namespace MoonTools.ECS
|
|||
}
|
||||
|
||||
archetype.RemoveEdges.Add(componentTypeId, nextArchetype);
|
||||
|
||||
if (!nextArchetype.AddEdges.ContainsKey(componentTypeId))
|
||||
{
|
||||
nextArchetype.AddEdges.Add(componentTypeId, archetype);
|
||||
}
|
||||
|
||||
return nextArchetype;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue