wip/no-type-lookup
copygirl 1 year ago
parent 33bbd75fbc
commit 0ff026d639
  1. 2
      src/gaemstone.ECS/Query.cs
  2. 19
      src/gaemstone.ECS/System.cs

@ -36,8 +36,8 @@ public unsafe class Query
public class QueryDesc : FilterDesc
{
public QueryDesc(string expression) : base(expression) { }
public QueryDesc(params Term[] terms) : base(terms) { }
public QueryDesc(string expression) : base(expression) { }
public new unsafe ecs_query_desc_t ToFlecs(IAllocator allocator)
{

@ -30,25 +30,6 @@ public static class SystemExtensions
callback(new Iterator(world, null, *iter));
}
// [UnmanagedCallersOnly]
// private static unsafe void Run(ecs_iter_t* flecsIter)
// {
// var (world, callback) = CallbackContextHelper
// .Get<(World, Action<Iterator>)>((nint)flecsIter->binding_ctx);
// // This is what flecs does, so I guess we'll do it too!
// var type = (&flecsIter->next == (delegate*<ecs_iter_t*, Runtime.CBool>)&ecs_query_next)
// ? IteratorType.Query : (IteratorType?)null;
// using var iter = new Iterator(world, type, *flecsIter);
// If the method is marked with [Source], set the $This variable.
// if (Method.Get<SourceAttribute>()?.Type is Type sourceType)
// iter.SetThis(World.LookupOrThrow(sourceType));
// if (flecsIter->field_count == 0) callback(iter);
// else while (iter.Next()) callback(iter);
// }
[UnmanagedCallersOnly]
private static unsafe void FreeContext(void* context)
=> CallbackContextHelper.Free((nint)context);

Loading…
Cancel
Save