Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Hypercube.Ecs/Entities/EntityRefAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ public delegate void EntityRefAction<T1, T2>(Entity entity, ref T1 component1, r

public delegate void EntityRefAction<T1, T2, T3>(Entity entity, ref T1 component1, ref T2 component2, ref T3 component3)
where T1 : IComponent where T2 : IComponent where T3 : IComponent;

public delegate void EntityRefAction<T1, T2, T3, T4>(Entity entity, ref T1 component1, ref T2 component2, ref T3 component3, ref T4 component4)
where T1 : IComponent where T2 : IComponent where T3 : IComponent where T4 : IComponent;
7 changes: 4 additions & 3 deletions src/Hypercube.Ecs/Events/Handling/EventHandlerList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ private void AddInternal(object handler, int priority)
try
{
var entry = new HandlerEntry(priority, handler);
if (priority == NoPriority)
var index = _handlers.FindIndex(h => priority > h.Priority);

if (index == -1)
{
_handlers.Add(entry);
return;
}

var index = _handlers.FindIndex(h => priority > h.Priority);

_handlers.Insert(index, entry);
}
finally
Expand Down
Loading