Skip to content

Commit

Permalink
sort - wip
Browse files Browse the repository at this point in the history
  • Loading branch information
friflo committed Mar 3, 2025
1 parent 0a1588d commit 92edeff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/ECS/Collections/EntityListSorter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ internal static MemberGetter<TComponent,TField> Getter(string memberName)
internal delegate TField MemberGetter<in TComponent, out TField> (TComponent component);




public struct ComponentField<TField> where TField : IComparable<TField>
{
public int entityId;
Expand Down
4 changes: 4 additions & 0 deletions src/Tests/ECS/Collections/Test_EntityList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,10 @@ public static void Test_EntityList_Sort_property()
AreEqual("id: 2, value: 0", fields[9].ToString());
AreEqual("id: 1, value: null", fields[10].ToString());

AreEqual(11, fields[0].entityId);
AreEqual(9, fields[0].field);
AreEqual(1, fields[0].hasField);

var start = Mem.GetAllocatedBytes();
for (int n = 0; n < 10; n++) {
fields = list.SortByComponentField<MyPropertyComponent, int>("value", SortOrder.Ascending, fields);
Expand Down

0 comments on commit 92edeff

Please sign in to comment.