Skip to content

Commit

Permalink
add support for simple aggregation group entity
Browse files Browse the repository at this point in the history
  • Loading branch information
sicusa committed Oct 20, 2023
1 parent 8d736fd commit 0f6e1f5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Sia/Views/Aggregator/AggregationGroup.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace Sia;

public record struct AggregationGroup<TId> : IAggregationEntity<TId>
where TId : IEquatable<TId>
{
public Aggregation<TId> Aggregation { get; set; }

public static EntityRef Create(World world)
=> world.GetHashHost<AggregationGroup<TId>>().Create();
}
5 changes: 5 additions & 0 deletions Sia/Views/Aggregator/Aggregator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,9 @@ private void RemoveFromAggregation(in EntityRef entity, in TId id)
aggrEntity.Dispose();
}
}
}

public class Aggregator<TId> : Aggregator<AggregationGroup<TId>, TId>
where TId : IEquatable<TId>
{
}

0 comments on commit 0f6e1f5

Please sign in to comment.