Skip to content

Commit

Permalink
Engine - Index: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
friflo committed Jun 21, 2024
1 parent 4e16c64 commit 0e71b07
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Engine/src/ECS/Lab/Component/IndexedComponentType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ namespace Friflo.Engine.ECS.Index;
internal readonly struct IndexedComponentType
{
internal readonly ComponentType componentType; // 8

/// <summary> If generic delegate of <see cref="CreateInvertedIndex{TValue}"/> </summary>
private readonly CreateIndex createIndex; // 8

private readonly Type indexType; // 8

private IndexedComponentType(ComponentType componentType, CreateIndex createIndex, Type indexType) {
Expand Down
5 changes: 4 additions & 1 deletion Engine/src/ECS/Lab/Indexes/ComponentIndex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ internal StoreIndex(IndexedComponentType type) {
}

internal ComponentIndex GetIndex(EntityStore store) {
return index ??= type.CreateComponentIndex(store);
if (index != null) {
return index;
}
return index = type.CreateComponentIndex(store);
}
}

0 comments on commit 0e71b07

Please sign in to comment.