Improve ecs query performance;
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
<#@ include file="Helpers.ttinclude" #>
|
||||
|
||||
using Ghost.Entities.Components;
|
||||
using Ghost.Entities.Query;
|
||||
|
||||
namespace Ghost.Entities;
|
||||
|
||||
@@ -24,7 +25,9 @@ public partial class World
|
||||
<#= restrictions #>
|
||||
{
|
||||
if (!(<#= tryGetPools #>))
|
||||
{
|
||||
return default;
|
||||
}
|
||||
|
||||
return new QueryEnumerable<<#= generics #>>(
|
||||
this,
|
||||
@@ -32,5 +35,20 @@ public partial class World
|
||||
<#= countSource #>);
|
||||
}
|
||||
|
||||
public QueryEnumerable<<#= generics #>> QueryFilter<<#= generics #>>(ref readonly QueryFilter filter)
|
||||
<#= restrictions #>
|
||||
{
|
||||
if (!(<#= tryGetPools #>))
|
||||
{
|
||||
return default;
|
||||
}
|
||||
|
||||
return new QueryEnumerable<<#= generics #>>(
|
||||
this,
|
||||
<#= poolParams #>,
|
||||
<#= countSource #>,
|
||||
in filter);
|
||||
}
|
||||
|
||||
<# } #>
|
||||
}
|
||||
Reference in New Issue
Block a user