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