You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

16 lines
436 B

using System;
using System.Linq;
using gaemstone.Utility.IL;
namespace gaemstone.ECS;
public static class FilterExtensions
{
public static void RunOnce(World world, Delegate action)
{
var gen = IterActionGenerator.GetOrBuild(world, action.Method);
var desc = new FilterDesc(gen.Terms.ToArray());
using var filter = new Filter(world, desc);
foreach (var iter in filter.Iter()) gen.RunWithTryCatch(action.Target, iter);
}
}