From 98ea3b0e33ec117bc886970674cc516b555a0505 Mon Sep 17 00:00:00 2001 From: BeanCheeseBurrito Date: Sun, 15 Sep 2024 10:20:52 -0700 Subject: [PATCH] Fix incorrect component fetching for managed structs. Fixes #35, fixes #39 --- src/Flecs.NET.Codegen/Generators/Invoker.cs | 42 +- src/Flecs.NET.Codegen/Generators/Query.cs | 18 +- src/Flecs.NET.Codegen/Helpers/Generator.cs | 13 +- .../CSharp/Core/EntityTests.cs | 39 +- src/Flecs.NET.Tests/CSharp/Core/QueryTests.cs | 36 ++ src/Flecs.NET.Tests/Helpers.cs | 12 + .../Core/BindingContext/QueryContext.cs | 6 +- src/Flecs.NET/Core/Entity.cs | 4 +- src/Flecs.NET/Core/Iter.cs | 2 +- src/Flecs.NET/Core/QueryBuilder.cs | 6 +- .../Invoker/Each/Iterator/T1.g.cs | 192 +++------- .../Invoker/Each/Iterator/T10.g.cs | 192 +++------- .../Invoker/Each/Iterator/T11.g.cs | 192 +++------- .../Invoker/Each/Iterator/T12.g.cs | 192 +++------- .../Invoker/Each/Iterator/T13.g.cs | 192 +++------- .../Invoker/Each/Iterator/T14.g.cs | 192 +++------- .../Invoker/Each/Iterator/T15.g.cs | 192 +++------- .../Invoker/Each/Iterator/T16.g.cs | 192 +++------- .../Invoker/Each/Iterator/T2.g.cs | 192 +++------- .../Invoker/Each/Iterator/T3.g.cs | 192 +++------- .../Invoker/Each/Iterator/T4.g.cs | 192 +++------- .../Invoker/Each/Iterator/T5.g.cs | 192 +++------- .../Invoker/Each/Iterator/T6.g.cs | 192 +++------- .../Invoker/Each/Iterator/T7.g.cs | 192 +++------- .../Invoker/Each/Iterator/T8.g.cs | 192 +++------- .../Invoker/Each/Iterator/T9.g.cs | 192 +++------- .../Invoker/Find/Iterator/T1.g.cs | 360 +++++------------- .../Invoker/Find/Iterator/T10.g.cs | 360 +++++------------- .../Invoker/Find/Iterator/T11.g.cs | 360 +++++------------- .../Invoker/Find/Iterator/T12.g.cs | 360 +++++------------- .../Invoker/Find/Iterator/T13.g.cs | 360 +++++------------- .../Invoker/Find/Iterator/T14.g.cs | 360 +++++------------- .../Invoker/Find/Iterator/T15.g.cs | 360 +++++------------- .../Invoker/Find/Iterator/T16.g.cs | 360 +++++------------- .../Invoker/Find/Iterator/T2.g.cs | 360 +++++------------- .../Invoker/Find/Iterator/T3.g.cs | 360 +++++------------- .../Invoker/Find/Iterator/T4.g.cs | 360 +++++------------- .../Invoker/Find/Iterator/T5.g.cs | 360 +++++------------- .../Invoker/Find/Iterator/T6.g.cs | 360 +++++------------- .../Invoker/Find/Iterator/T7.g.cs | 360 +++++------------- .../Invoker/Find/Iterator/T8.g.cs | 360 +++++------------- .../Invoker/Find/Iterator/T9.g.cs | 360 +++++------------- .../Flecs.NET.Codegen/Query/Query/T1.g.cs | 16 + .../Flecs.NET.Codegen/Query/Query/T10.g.cs | 16 + .../Flecs.NET.Codegen/Query/Query/T11.g.cs | 16 + .../Flecs.NET.Codegen/Query/Query/T12.g.cs | 16 + .../Flecs.NET.Codegen/Query/Query/T13.g.cs | 16 + .../Flecs.NET.Codegen/Query/Query/T14.g.cs | 16 + .../Flecs.NET.Codegen/Query/Query/T15.g.cs | 16 + .../Flecs.NET.Codegen/Query/Query/T16.g.cs | 16 + .../Flecs.NET.Codegen/Query/Query/T2.g.cs | 16 + .../Flecs.NET.Codegen/Query/Query/T3.g.cs | 16 + .../Flecs.NET.Codegen/Query/Query/T4.g.cs | 16 + .../Flecs.NET.Codegen/Query/Query/T5.g.cs | 16 + .../Flecs.NET.Codegen/Query/Query/T6.g.cs | 16 + .../Flecs.NET.Codegen/Query/Query/T7.g.cs | 16 + .../Flecs.NET.Codegen/Query/Query/T8.g.cs | 16 + .../Flecs.NET.Codegen/Query/Query/T9.g.cs | 16 + 58 files changed, 2684 insertions(+), 6582 deletions(-) diff --git a/src/Flecs.NET.Codegen/Generators/Invoker.cs b/src/Flecs.NET.Codegen/Generators/Invoker.cs index e8622eda..b90556b8 100644 --- a/src/Flecs.NET.Codegen/Generators/Invoker.cs +++ b/src/Flecs.NET.Codegen/Generators/Invoker.cs @@ -75,20 +75,12 @@ private static string GenerateEachIteratorInvokers(int i) {{Generator.GetCallbackCountVariable(callback)}} {{Generator.IterPointerVariables[i]}} + {{Generator.IterStepVariables[i]}} Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback({{Generator.GetCallbackArguments(i, callback)}}); - } - else - { - {{Generator.IterStepVariables[i]}} - for (int i = 0; i < count; i++) - callback({{Generator.GetCallbackSteppedArguments(i, callback)}}); - } + for (int i = 0; i < count; i++, {{Generator.IterPointerIncrements[i]}}) + callback({{Generator.GetCallbackSteppedArguments(i, callback)}}); Ecs.TableUnlock(it); } @@ -121,33 +113,19 @@ private static string GenerateFindIteratorInvokers(int i) {{Generator.GetCallbackCountVariable(callback)}} {{Generator.IterPointerVariables[i]}} + {{Generator.IterStepVariables[i]}} Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, {{Generator.IterPointerIncrements[i]}}) { - for (int i = 0; i < count; i++) - { - if (!callback({{Generator.GetCallbackArguments(i, callback)}})) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - {{Generator.IterStepVariables[i]}} - for (int i = 0; i < count; i++) - { - if (!callback({{Generator.GetCallbackSteppedArguments(i, callback)}})) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback({{Generator.GetCallbackSteppedArguments(i, callback)}})) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); diff --git a/src/Flecs.NET.Codegen/Generators/Query.cs b/src/Flecs.NET.Codegen/Generators/Query.cs index 1bf0155e..76ba875d 100644 --- a/src/Flecs.NET.Codegen/Generators/Query.cs +++ b/src/Flecs.NET.Codegen/Generators/Query.cs @@ -35,7 +35,7 @@ namespace Flecs.NET.Core; /// A type-safe wrapper around that takes {{i + 1}} type arguments. /// /// {{Generator.XmlTypeParameters[i]}} - public unsafe partial struct Query<{{Generator.TypeParameters[i]}}> : IDisposable, IEquatable> + public unsafe partial struct {{Generator.GetTypeName(Type.Query, i)}} : IDisposable, IEquatable<{{Generator.GetTypeName(Type.Query, i)}}> { private Query _query; @@ -202,6 +202,22 @@ public override int GetHashCode() } } + // Flecs.NET Extensions + public unsafe partial struct {{Generator.GetTypeName(Type.Query, i)}} + { + /// + public World World() + { + return _query.World(); + } + + /// + public World RealWorld() + { + return _query.RealWorld(); + } + } + // IIterableBase Interface public unsafe partial struct {{Generator.GetTypeName(Type.Query, i)}} : IIterableBase { diff --git a/src/Flecs.NET.Codegen/Helpers/Generator.cs b/src/Flecs.NET.Codegen/Helpers/Generator.cs index 94d50d53..3414de51 100644 --- a/src/Flecs.NET.Codegen/Helpers/Generator.cs +++ b/src/Flecs.NET.Codegen/Helpers/Generator.cs @@ -178,14 +178,17 @@ public static class Generator #endregion - #region Invoker Variables + #region Invoker - // Generates "T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1);..." - public static readonly string[] IterPointerVariables = CacheJoinedStrings(Separator.Space, i => $"T{i}* pointer{i} = it.GetPointer({i});"); + // Generates "byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1);..." + public static readonly string[] IterPointerVariables = CacheJoinedStrings(Separator.Space, i => $"byte* pointer{i} = (byte*)it.GetPointer({i});"); // Generates "int step0 = it.Step(0); int step1 = it.Step(1);..." public static readonly string[] IterStepVariables = CacheJoinedStrings(Separator.Space, i => $"int step{i} = it.Step({i});"); + // Generates "pointer0 = &pointer0[step0], pointer1 = &pointer1[step1]..." + public static readonly string[] IterPointerIncrements = CacheJoinedStrings(Separator.Comma, i => $"pointer{i} = &pointer{i}[step{i}]"); + #endregion #region Invoker Callback Arguments @@ -218,7 +221,7 @@ public static class Generator public static readonly string[] EachIterPointerArguments = CacheStrings(i => $"it, i, {EachPointerArguments[i]}"); // Generates "ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2])..." - public static readonly string[] EachRefSteppedArguments = CacheJoinedStrings(Separator.Comma, i => $"ref Managed.GetTypeRef(&pointer{i}[i * step{i}])"); + public static readonly string[] EachRefSteppedArguments = CacheJoinedStrings(Separator.Comma, i => $"ref Managed.GetTypeRef(pointer{i})"); // Generates "new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2])" public static readonly string[] EachEntityRefSteppedArguments = CacheStrings(i => $"new Entity(it.Handle->world, it.Handle->entities[i]), {EachRefSteppedArguments[i]}"); @@ -227,7 +230,7 @@ public static class Generator public static readonly string[] EachIterRefSteppedArguments = CacheStrings(i => $"it, i, {EachRefSteppedArguments[i]}"); // Generates "&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2]..." - public static readonly string[] EachPointerSteppedArguments = CacheJoinedStrings(Separator.Comma, i => $"&pointer{i}[i * step{i}]"); + public static readonly string[] EachPointerSteppedArguments = CacheJoinedStrings(Separator.Comma, i => $"(T{i}*)pointer{i}"); // Generates "new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2]..." public static readonly string[] EachEntityPointerSteppedArguments = CacheStrings(i => $"new Entity(it.Handle->world, it.Handle->entities[i]), {EachPointerSteppedArguments[i]}"); diff --git a/src/Flecs.NET.Tests/CSharp/Core/EntityTests.cs b/src/Flecs.NET.Tests/CSharp/Core/EntityTests.cs index c03a96fe..ccb100b2 100644 --- a/src/Flecs.NET.Tests/CSharp/Core/EntityTests.cs +++ b/src/Flecs.NET.Tests/CSharp/Core/EntityTests.cs @@ -6,26 +6,49 @@ namespace Flecs.NET.Tests.CSharp.Core public class EntityTests { [Fact] - public void AddManaged() + public void AddManagedClass() { using World world = World.Create(); Entity entity = world.Entity(); - entity.Add(); - Assert.True(entity.Has()); + entity.Add(); + Assert.True(entity.Has()); } [Fact] - public void SetManaged() + public void SetManagedClass() { using World world = World.Create(); Entity entity = world.Entity(); - entity.Set("Text"); - Assert.True(entity.Has()); + entity.Set(new ManagedClass(10)); + Assert.True(entity.Has()); - ref readonly string str = ref entity.Get(); - Assert.True(str == "Text"); + ref readonly ManagedClass component = ref entity.Get(); + Assert.True(component.Value == 10); + } + + [Fact] + public void AddManagedStruct() + { + using World world = World.Create(); + Entity entity = world.Entity(); + + entity.Add(); + Assert.True(entity.Has()); + } + + [Fact] + public void SetManagedStruct() + { + using World world = World.Create(); + Entity entity = world.Entity(); + + entity.Set(new ManagedStruct(10)); + Assert.True(entity.Has()); + + ref readonly ManagedStruct component = ref entity.Get(); + Assert.True(component.Value == 10); } } } diff --git a/src/Flecs.NET.Tests/CSharp/Core/QueryTests.cs b/src/Flecs.NET.Tests/CSharp/Core/QueryTests.cs index 6200e10a..bcffc7e6 100644 --- a/src/Flecs.NET.Tests/CSharp/Core/QueryTests.cs +++ b/src/Flecs.NET.Tests/CSharp/Core/QueryTests.cs @@ -785,5 +785,41 @@ static void Callback(Iter it) } } } + + [Fact] + private void EachManagedClass() + { + using World world = World.Create(); + using Query query = world.Query(); + + for (int i = 0; i < 5; i ++) + world.Entity().Set(new ManagedClass(10)); + + Assert.True(query.IsTrue()); + Assert.Equal(5, query.Count()); + + query.Each(static (Iter _, int i, ref ManagedClass component) => + { + Assert.Equal(10, component.Value); + }); + } + + [Fact] + private void EachManagedStruct() + { + using World world = World.Create(); + using Query query = world.Query(); + + for (int i = 0; i < 5; i ++) + world.Entity().Set(new ManagedStruct(10)); + + Assert.True(query.IsTrue()); + Assert.Equal(5, query.Count()); + + query.Each(static (Iter it, int i, ref ManagedStruct component) => + { + Assert.Equal(10, component.Value); + }); + } } } diff --git a/src/Flecs.NET.Tests/Helpers.cs b/src/Flecs.NET.Tests/Helpers.cs index 2f11657e..2b5e81dd 100644 --- a/src/Flecs.NET.Tests/Helpers.cs +++ b/src/Flecs.NET.Tests/Helpers.cs @@ -29,12 +29,24 @@ public record struct Other(int Value); public record struct Singleton(int Value); public record struct PositionInitialized(float X, float Y); +public record struct ManagedStruct(int Value) +{ + public object Dummy = null!; +} + +public class ManagedClass(int value) +{ + public int Value = value; + public object Dummy = null!; +} + public class ManagedComponent { public string Value = null!; public ManagedComponent Nested = null!; } + public struct Base; public struct Prefab; diff --git a/src/Flecs.NET/Core/BindingContext/QueryContext.cs b/src/Flecs.NET/Core/BindingContext/QueryContext.cs index cc0f06f7..ebe32f49 100644 --- a/src/Flecs.NET/Core/BindingContext/QueryContext.cs +++ b/src/Flecs.NET/Core/BindingContext/QueryContext.cs @@ -8,9 +8,10 @@ internal struct QueryContext : IDisposable { public Callback OrderByAction; public Callback GroupByAction; - public Callback ContextFree; + public Callback GroupByContextFree; public Callback GroupCreateAction; public Callback GroupDeleteAction; + public Callback ContextFree; public NativeList Strings; @@ -18,9 +19,10 @@ public void Dispose() { OrderByAction.Dispose(); GroupByAction.Dispose(); - ContextFree.Dispose(); + GroupByContextFree.Dispose(); GroupCreateAction.Dispose(); GroupDeleteAction.Dispose(); + ContextFree.Dispose(); if (Strings == default) return; diff --git a/src/Flecs.NET/Core/Entity.cs b/src/Flecs.NET/Core/Entity.cs index 0b155be6..69b32dd2 100644 --- a/src/Flecs.NET/Core/Entity.cs +++ b/src/Flecs.NET/Core/Entity.cs @@ -3780,11 +3780,11 @@ private ref Entity SetInternal(ulong id, T* component) if (RuntimeHelpers.IsReferenceOrContainsReferences()) { Managed.AllocGcHandle(component, out GCHandle handle); - ecs_set_id(World, Id, id, (IntPtr)sizeof(T), &handle); + ecs_set_id(World, Id, id, sizeof(GCHandle), &handle); } else { - ecs_set_id(World, Id, id, (IntPtr)sizeof(T), component); + ecs_set_id(World, Id, id, sizeof(T), component); } return ref this; diff --git a/src/Flecs.NET/Core/Iter.cs b/src/Flecs.NET/Core/Iter.cs index 2ceb0517..06f293bf 100644 --- a/src/Flecs.NET/Core/Iter.cs +++ b/src/Flecs.NET/Core/Iter.cs @@ -682,7 +682,7 @@ internal Span GetSpan(int index) [MethodImpl(MethodImplOptions.AggressiveInlining)] internal int Step(int index) { - return (Handle->sources == null || Handle->sources[index] == 0) && (Handle->set_fields & (1 << index)) != 0 && !Type.IsTag ? 1 : 0; + return (Handle->sources == null || Handle->sources[index] == 0) && (Handle->set_fields & (1 << index)) != 0 && !Type.IsTag ? Type.Size : 0; } [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/src/Flecs.NET/Core/QueryBuilder.cs b/src/Flecs.NET/Core/QueryBuilder.cs index 7330a86c..393e634e 100644 --- a/src/Flecs.NET/Core/QueryBuilder.cs +++ b/src/Flecs.NET/Core/QueryBuilder.cs @@ -1715,7 +1715,7 @@ public ref QueryBuilder GroupBy(ulong component, Ecs.GroupByCallback callback) "Cannot set .GroupBy callback if group_by_ctx is already occupied."); Context.GroupByAction.Dispose(); - Context.ContextFree.Dispose(); + Context.GroupByContextFree.Dispose(); GroupByContext* context = Memory.AllocZeroed(1); Callback.Set(ref context->GroupBy, callback); @@ -1746,8 +1746,8 @@ public ref QueryBuilder GroupBy(Ecs.GroupByCallback callback) /// public ref QueryBuilder GroupByCtx(void* ctx, Ecs.ContextFree contextFree) { - Callback.Set(ref Context.ContextFree, contextFree); - Desc.group_by_ctx_free = Context.ContextFree.Pointer; + Callback.Set(ref Context.GroupByContextFree, contextFree); + Desc.group_by_ctx_free = Context.GroupByContextFree.Pointer; Desc.group_by_ctx = ctx; return ref this; } diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T1.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T1.g.cs index af5a294e..cd3c5e5e 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T1.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T1.g.cs @@ -17,21 +17,13 @@ public static void Each(Iter it, Ecs.EachRefCallback callback) { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); + byte* pointer0 = (byte*)it.GetPointer(0); + int step0 = it.Step(0); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i])); - } - else - { - int step0 = it.Step(0); - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i * step0])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0]) + callback(ref Managed.GetTypeRef(pointer0)); Ecs.TableUnlock(it); } @@ -46,21 +38,13 @@ public static void Each(Iter it, Ecs.EachEntityRefCallback callback) { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); + byte* pointer0 = (byte*)it.GetPointer(0); + int step0 = it.Step(0); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i])); - } - else - { - int step0 = it.Step(0); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0)); Ecs.TableUnlock(it); } @@ -75,21 +59,13 @@ public static void Each(Iter it, Ecs.EachIterRefCallback callback) { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); + byte* pointer0 = (byte*)it.GetPointer(0); + int step0 = it.Step(0); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i])); - } - else - { - int step0 = it.Step(0); - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0]) + callback(it, i, ref Managed.GetTypeRef(pointer0)); Ecs.TableUnlock(it); } @@ -104,21 +80,13 @@ public static void Each(Iter it, delegate* callback) { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); + byte* pointer0 = (byte*)it.GetPointer(0); + int step0 = it.Step(0); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i])); - } - else - { - int step0 = it.Step(0); - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i * step0])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0]) + callback(ref Managed.GetTypeRef(pointer0)); Ecs.TableUnlock(it); } @@ -133,21 +101,13 @@ public static void Each(Iter it, delegate* callback) { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); + byte* pointer0 = (byte*)it.GetPointer(0); + int step0 = it.Step(0); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i])); - } - else - { - int step0 = it.Step(0); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0)); Ecs.TableUnlock(it); } @@ -162,21 +122,13 @@ public static void Each(Iter it, delegate* callback { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); + byte* pointer0 = (byte*)it.GetPointer(0); + int step0 = it.Step(0); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i])); - } - else - { - int step0 = it.Step(0); - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0]) + callback(it, i, ref Managed.GetTypeRef(pointer0)); Ecs.TableUnlock(it); } @@ -191,21 +143,13 @@ public static void Each(Iter it, Ecs.EachPointerCallback callback) { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); + byte* pointer0 = (byte*)it.GetPointer(0); + int step0 = it.Step(0); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(&pointer0[i]); - } - else - { - int step0 = it.Step(0); - for (int i = 0; i < count; i++) - callback(&pointer0[i * step0]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0]) + callback((T0*)pointer0); Ecs.TableUnlock(it); } @@ -220,21 +164,13 @@ public static void Each(Iter it, Ecs.EachEntityPointerCallback callback) { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); + byte* pointer0 = (byte*)it.GetPointer(0); + int step0 = it.Step(0); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i]); - } - else - { - int step0 = it.Step(0); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0); Ecs.TableUnlock(it); } @@ -249,21 +185,13 @@ public static void Each(Iter it, Ecs.EachIterPointerCallback callback) { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); + byte* pointer0 = (byte*)it.GetPointer(0); + int step0 = it.Step(0); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i]); - } - else - { - int step0 = it.Step(0); - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i * step0]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0]) + callback(it, i, (T0*)pointer0); Ecs.TableUnlock(it); } @@ -278,21 +206,13 @@ public static void Each(Iter it, delegate* callback) { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); + byte* pointer0 = (byte*)it.GetPointer(0); + int step0 = it.Step(0); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(&pointer0[i]); - } - else - { - int step0 = it.Step(0); - for (int i = 0; i < count; i++) - callback(&pointer0[i * step0]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0]) + callback((T0*)pointer0); Ecs.TableUnlock(it); } @@ -307,21 +227,13 @@ public static void Each(Iter it, delegate* callback) { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); + byte* pointer0 = (byte*)it.GetPointer(0); + int step0 = it.Step(0); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i]); - } - else - { - int step0 = it.Step(0); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0); Ecs.TableUnlock(it); } @@ -336,21 +248,13 @@ public static void Each(Iter it, delegate* callback) { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); + byte* pointer0 = (byte*)it.GetPointer(0); + int step0 = it.Step(0); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i]); - } - else - { - int step0 = it.Step(0); - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i * step0]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0]) + callback(it, i, (T0*)pointer0); Ecs.TableUnlock(it); } diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T10.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T10.g.cs index 0d43b077..b5534e21 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T10.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T10.g.cs @@ -17,21 +17,13 @@ public static void Each(Iter it, Ecs.Eac { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9]) + callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9)); Ecs.TableUnlock(it); } @@ -46,21 +38,13 @@ public static void Each(Iter it, Ecs.Eac { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9)); Ecs.TableUnlock(it); } @@ -75,21 +59,13 @@ public static void Each(Iter it, Ecs.Eac { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9]) + callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9)); Ecs.TableUnlock(it); } @@ -104,21 +80,13 @@ public static void Each(Iter it, delegat { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9]) + callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9)); Ecs.TableUnlock(it); } @@ -133,21 +101,13 @@ public static void Each(Iter it, delegat { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9)); Ecs.TableUnlock(it); } @@ -162,21 +122,13 @@ public static void Each(Iter it, delegat { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9]) + callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9)); Ecs.TableUnlock(it); } @@ -191,21 +143,13 @@ public static void Each(Iter it, Ecs.Eac { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); - for (int i = 0; i < count; i++) - callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9]) + callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9); Ecs.TableUnlock(it); } @@ -220,21 +164,13 @@ public static void Each(Iter it, Ecs.Eac { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9); Ecs.TableUnlock(it); } @@ -249,21 +185,13 @@ public static void Each(Iter it, Ecs.Eac { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9]) + callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9); Ecs.TableUnlock(it); } @@ -278,21 +206,13 @@ public static void Each(Iter it, delegat { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); - for (int i = 0; i < count; i++) - callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9]) + callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9); Ecs.TableUnlock(it); } @@ -307,21 +227,13 @@ public static void Each(Iter it, delegat { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9); Ecs.TableUnlock(it); } @@ -336,21 +248,13 @@ public static void Each(Iter it, delegat { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9]) + callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9); Ecs.TableUnlock(it); } diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T11.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T11.g.cs index 3d0f5ef7..7bfc51c8 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T11.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T11.g.cs @@ -17,21 +17,13 @@ public static void Each(Iter it, Ec { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10]) + callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10)); Ecs.TableUnlock(it); } @@ -46,21 +38,13 @@ public static void Each(Iter it, Ec { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10)); Ecs.TableUnlock(it); } @@ -75,21 +59,13 @@ public static void Each(Iter it, Ec { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10]) + callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10)); Ecs.TableUnlock(it); } @@ -104,21 +80,13 @@ public static void Each(Iter it, de { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10]) + callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10)); Ecs.TableUnlock(it); } @@ -133,21 +101,13 @@ public static void Each(Iter it, de { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10)); Ecs.TableUnlock(it); } @@ -162,21 +122,13 @@ public static void Each(Iter it, de { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10]) + callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10)); Ecs.TableUnlock(it); } @@ -191,21 +143,13 @@ public static void Each(Iter it, Ec { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); - for (int i = 0; i < count; i++) - callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10]) + callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10); Ecs.TableUnlock(it); } @@ -220,21 +164,13 @@ public static void Each(Iter it, Ec { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10); Ecs.TableUnlock(it); } @@ -249,21 +185,13 @@ public static void Each(Iter it, Ec { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10]) + callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10); Ecs.TableUnlock(it); } @@ -278,21 +206,13 @@ public static void Each(Iter it, de { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); - for (int i = 0; i < count; i++) - callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10]) + callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10); Ecs.TableUnlock(it); } @@ -307,21 +227,13 @@ public static void Each(Iter it, de { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10); Ecs.TableUnlock(it); } @@ -336,21 +248,13 @@ public static void Each(Iter it, de { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10]) + callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10); Ecs.TableUnlock(it); } diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T12.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T12.g.cs index 4c8bde2d..dd16c30e 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T12.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T12.g.cs @@ -17,21 +17,13 @@ public static void Each(Iter i { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11]) + callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11)); Ecs.TableUnlock(it); } @@ -46,21 +38,13 @@ public static void Each(Iter i { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11)); Ecs.TableUnlock(it); } @@ -75,21 +59,13 @@ public static void Each(Iter i { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11]) + callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11)); Ecs.TableUnlock(it); } @@ -104,21 +80,13 @@ public static void Each(Iter i { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11]) + callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11)); Ecs.TableUnlock(it); } @@ -133,21 +101,13 @@ public static void Each(Iter i { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11)); Ecs.TableUnlock(it); } @@ -162,21 +122,13 @@ public static void Each(Iter i { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11]) + callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11)); Ecs.TableUnlock(it); } @@ -191,21 +143,13 @@ public static void Each(Iter i { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); - for (int i = 0; i < count; i++) - callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11]) + callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11); Ecs.TableUnlock(it); } @@ -220,21 +164,13 @@ public static void Each(Iter i { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11); Ecs.TableUnlock(it); } @@ -249,21 +185,13 @@ public static void Each(Iter i { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11]) + callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11); Ecs.TableUnlock(it); } @@ -278,21 +206,13 @@ public static void Each(Iter i { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); - for (int i = 0; i < count; i++) - callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11]) + callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11); Ecs.TableUnlock(it); } @@ -307,21 +227,13 @@ public static void Each(Iter i { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11); Ecs.TableUnlock(it); } @@ -336,21 +248,13 @@ public static void Each(Iter i { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11]) + callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11); Ecs.TableUnlock(it); } diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T13.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T13.g.cs index 85df531a..b03f8aae 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T13.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T13.g.cs @@ -17,21 +17,13 @@ public static void Each(I { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12]) + callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12)); Ecs.TableUnlock(it); } @@ -46,21 +38,13 @@ public static void Each(I { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12)); Ecs.TableUnlock(it); } @@ -75,21 +59,13 @@ public static void Each(I { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12]) + callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12)); Ecs.TableUnlock(it); } @@ -104,21 +80,13 @@ public static void Each(I { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12]) + callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12)); Ecs.TableUnlock(it); } @@ -133,21 +101,13 @@ public static void Each(I { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12)); Ecs.TableUnlock(it); } @@ -162,21 +122,13 @@ public static void Each(I { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12]) + callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12)); Ecs.TableUnlock(it); } @@ -191,21 +143,13 @@ public static void Each(I { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); - for (int i = 0; i < count; i++) - callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12]) + callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12); Ecs.TableUnlock(it); } @@ -220,21 +164,13 @@ public static void Each(I { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12); Ecs.TableUnlock(it); } @@ -249,21 +185,13 @@ public static void Each(I { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12]) + callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12); Ecs.TableUnlock(it); } @@ -278,21 +206,13 @@ public static void Each(I { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); - for (int i = 0; i < count; i++) - callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12]) + callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12); Ecs.TableUnlock(it); } @@ -307,21 +227,13 @@ public static void Each(I { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12); Ecs.TableUnlock(it); } @@ -336,21 +248,13 @@ public static void Each(I { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12]) + callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12); Ecs.TableUnlock(it); } diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T14.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T14.g.cs index 1da5a8c5..118bf50c 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T14.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T14.g.cs @@ -17,21 +17,13 @@ public static void Eachcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13]) + callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13)); Ecs.TableUnlock(it); } @@ -46,21 +38,13 @@ public static void Eachcount; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13)); Ecs.TableUnlock(it); } @@ -75,21 +59,13 @@ public static void Eachcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13]) + callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13)); Ecs.TableUnlock(it); } @@ -104,21 +80,13 @@ public static void Eachcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13]) + callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13)); Ecs.TableUnlock(it); } @@ -133,21 +101,13 @@ public static void Eachcount; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13)); Ecs.TableUnlock(it); } @@ -162,21 +122,13 @@ public static void Eachcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13]) + callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13)); Ecs.TableUnlock(it); } @@ -191,21 +143,13 @@ public static void Eachcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); - for (int i = 0; i < count; i++) - callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13]) + callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13); Ecs.TableUnlock(it); } @@ -220,21 +164,13 @@ public static void Eachcount; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13); Ecs.TableUnlock(it); } @@ -249,21 +185,13 @@ public static void Eachcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13]) + callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13); Ecs.TableUnlock(it); } @@ -278,21 +206,13 @@ public static void Eachcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); - for (int i = 0; i < count; i++) - callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13]) + callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13); Ecs.TableUnlock(it); } @@ -307,21 +227,13 @@ public static void Eachcount; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13); Ecs.TableUnlock(it); } @@ -336,21 +248,13 @@ public static void Eachcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13]) + callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13); Ecs.TableUnlock(it); } diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T15.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T15.g.cs index d2d2ee28..34029ada 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T15.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T15.g.cs @@ -17,21 +17,13 @@ public static void Eachcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i]), ref Managed.GetTypeRef(&pointer14[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13]), ref Managed.GetTypeRef(&pointer14[i * step14])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14]) + callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13), ref Managed.GetTypeRef(pointer14)); Ecs.TableUnlock(it); } @@ -46,21 +38,13 @@ public static void Eachcount; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i]), ref Managed.GetTypeRef(&pointer14[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13]), ref Managed.GetTypeRef(&pointer14[i * step14])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13), ref Managed.GetTypeRef(pointer14)); Ecs.TableUnlock(it); } @@ -75,21 +59,13 @@ public static void Eachcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i]), ref Managed.GetTypeRef(&pointer14[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13]), ref Managed.GetTypeRef(&pointer14[i * step14])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14]) + callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13), ref Managed.GetTypeRef(pointer14)); Ecs.TableUnlock(it); } @@ -104,21 +80,13 @@ public static void Eachcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i]), ref Managed.GetTypeRef(&pointer14[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13]), ref Managed.GetTypeRef(&pointer14[i * step14])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14]) + callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13), ref Managed.GetTypeRef(pointer14)); Ecs.TableUnlock(it); } @@ -133,21 +101,13 @@ public static void Eachcount; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i]), ref Managed.GetTypeRef(&pointer14[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13]), ref Managed.GetTypeRef(&pointer14[i * step14])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13), ref Managed.GetTypeRef(pointer14)); Ecs.TableUnlock(it); } @@ -162,21 +122,13 @@ public static void Eachcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i]), ref Managed.GetTypeRef(&pointer14[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13]), ref Managed.GetTypeRef(&pointer14[i * step14])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14]) + callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13), ref Managed.GetTypeRef(pointer14)); Ecs.TableUnlock(it); } @@ -191,21 +143,13 @@ public static void Eachcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i], &pointer14[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); - for (int i = 0; i < count; i++) - callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13], &pointer14[i * step14]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14]) + callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13, (T14*)pointer14); Ecs.TableUnlock(it); } @@ -220,21 +164,13 @@ public static void Eachcount; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i], &pointer14[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13], &pointer14[i * step14]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13, (T14*)pointer14); Ecs.TableUnlock(it); } @@ -249,21 +185,13 @@ public static void Eachcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i], &pointer14[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13], &pointer14[i * step14]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14]) + callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13, (T14*)pointer14); Ecs.TableUnlock(it); } @@ -278,21 +206,13 @@ public static void Eachcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i], &pointer14[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); - for (int i = 0; i < count; i++) - callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13], &pointer14[i * step14]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14]) + callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13, (T14*)pointer14); Ecs.TableUnlock(it); } @@ -307,21 +227,13 @@ public static void Eachcount; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i], &pointer14[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13], &pointer14[i * step14]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13, (T14*)pointer14); Ecs.TableUnlock(it); } @@ -336,21 +248,13 @@ public static void Eachcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i], &pointer14[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13], &pointer14[i * step14]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14]) + callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13, (T14*)pointer14); Ecs.TableUnlock(it); } diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T16.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T16.g.cs index 4e628137..27139a45 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T16.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T16.g.cs @@ -17,21 +17,13 @@ public static void Eachcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); T15* pointer15 = it.GetPointer(15); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); byte* pointer15 = (byte*)it.GetPointer(15); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i]), ref Managed.GetTypeRef(&pointer14[i]), ref Managed.GetTypeRef(&pointer15[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13]), ref Managed.GetTypeRef(&pointer14[i * step14]), ref Managed.GetTypeRef(&pointer15[i * step15])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14], pointer15 = &pointer15[step15]) + callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13), ref Managed.GetTypeRef(pointer14), ref Managed.GetTypeRef(pointer15)); Ecs.TableUnlock(it); } @@ -46,21 +38,13 @@ public static void Eachcount; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); T15* pointer15 = it.GetPointer(15); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); byte* pointer15 = (byte*)it.GetPointer(15); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i]), ref Managed.GetTypeRef(&pointer14[i]), ref Managed.GetTypeRef(&pointer15[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13]), ref Managed.GetTypeRef(&pointer14[i * step14]), ref Managed.GetTypeRef(&pointer15[i * step15])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14], pointer15 = &pointer15[step15]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13), ref Managed.GetTypeRef(pointer14), ref Managed.GetTypeRef(pointer15)); Ecs.TableUnlock(it); } @@ -75,21 +59,13 @@ public static void Eachcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); T15* pointer15 = it.GetPointer(15); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); byte* pointer15 = (byte*)it.GetPointer(15); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i]), ref Managed.GetTypeRef(&pointer14[i]), ref Managed.GetTypeRef(&pointer15[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13]), ref Managed.GetTypeRef(&pointer14[i * step14]), ref Managed.GetTypeRef(&pointer15[i * step15])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14], pointer15 = &pointer15[step15]) + callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13), ref Managed.GetTypeRef(pointer14), ref Managed.GetTypeRef(pointer15)); Ecs.TableUnlock(it); } @@ -104,21 +80,13 @@ public static void Eachcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); T15* pointer15 = it.GetPointer(15); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); byte* pointer15 = (byte*)it.GetPointer(15); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i]), ref Managed.GetTypeRef(&pointer14[i]), ref Managed.GetTypeRef(&pointer15[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13]), ref Managed.GetTypeRef(&pointer14[i * step14]), ref Managed.GetTypeRef(&pointer15[i * step15])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14], pointer15 = &pointer15[step15]) + callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13), ref Managed.GetTypeRef(pointer14), ref Managed.GetTypeRef(pointer15)); Ecs.TableUnlock(it); } @@ -133,21 +101,13 @@ public static void Eachcount; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); T15* pointer15 = it.GetPointer(15); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); byte* pointer15 = (byte*)it.GetPointer(15); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i]), ref Managed.GetTypeRef(&pointer14[i]), ref Managed.GetTypeRef(&pointer15[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13]), ref Managed.GetTypeRef(&pointer14[i * step14]), ref Managed.GetTypeRef(&pointer15[i * step15])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14], pointer15 = &pointer15[step15]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13), ref Managed.GetTypeRef(pointer14), ref Managed.GetTypeRef(pointer15)); Ecs.TableUnlock(it); } @@ -162,21 +122,13 @@ public static void Eachcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); T15* pointer15 = it.GetPointer(15); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); byte* pointer15 = (byte*)it.GetPointer(15); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i]), ref Managed.GetTypeRef(&pointer14[i]), ref Managed.GetTypeRef(&pointer15[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13]), ref Managed.GetTypeRef(&pointer14[i * step14]), ref Managed.GetTypeRef(&pointer15[i * step15])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14], pointer15 = &pointer15[step15]) + callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13), ref Managed.GetTypeRef(pointer14), ref Managed.GetTypeRef(pointer15)); Ecs.TableUnlock(it); } @@ -191,21 +143,13 @@ public static void Eachcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); T15* pointer15 = it.GetPointer(15); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); byte* pointer15 = (byte*)it.GetPointer(15); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i], &pointer14[i], &pointer15[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); - for (int i = 0; i < count; i++) - callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13], &pointer14[i * step14], &pointer15[i * step15]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14], pointer15 = &pointer15[step15]) + callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13, (T14*)pointer14, (T15*)pointer15); Ecs.TableUnlock(it); } @@ -220,21 +164,13 @@ public static void Eachcount; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); T15* pointer15 = it.GetPointer(15); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); byte* pointer15 = (byte*)it.GetPointer(15); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i], &pointer14[i], &pointer15[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13], &pointer14[i * step14], &pointer15[i * step15]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14], pointer15 = &pointer15[step15]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13, (T14*)pointer14, (T15*)pointer15); Ecs.TableUnlock(it); } @@ -249,21 +185,13 @@ public static void Eachcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); T15* pointer15 = it.GetPointer(15); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); byte* pointer15 = (byte*)it.GetPointer(15); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i], &pointer14[i], &pointer15[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13], &pointer14[i * step14], &pointer15[i * step15]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14], pointer15 = &pointer15[step15]) + callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13, (T14*)pointer14, (T15*)pointer15); Ecs.TableUnlock(it); } @@ -278,21 +206,13 @@ public static void Eachcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); T15* pointer15 = it.GetPointer(15); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); byte* pointer15 = (byte*)it.GetPointer(15); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i], &pointer14[i], &pointer15[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); - for (int i = 0; i < count; i++) - callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13], &pointer14[i * step14], &pointer15[i * step15]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14], pointer15 = &pointer15[step15]) + callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13, (T14*)pointer14, (T15*)pointer15); Ecs.TableUnlock(it); } @@ -307,21 +227,13 @@ public static void Eachcount; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); T15* pointer15 = it.GetPointer(15); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); byte* pointer15 = (byte*)it.GetPointer(15); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i], &pointer14[i], &pointer15[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13], &pointer14[i * step14], &pointer15[i * step15]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14], pointer15 = &pointer15[step15]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13, (T14*)pointer14, (T15*)pointer15); Ecs.TableUnlock(it); } @@ -336,21 +248,13 @@ public static void Eachcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); T15* pointer15 = it.GetPointer(15); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); byte* pointer15 = (byte*)it.GetPointer(15); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i], &pointer14[i], &pointer15[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13], &pointer14[i * step14], &pointer15[i * step15]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14], pointer15 = &pointer15[step15]) + callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13, (T14*)pointer14, (T15*)pointer15); Ecs.TableUnlock(it); } diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T2.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T2.g.cs index 15397dfd..78488736 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T2.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T2.g.cs @@ -17,21 +17,13 @@ public static void Each(Iter it, Ecs.EachRefCallback callback) { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); + int step0 = it.Step(0); int step1 = it.Step(1); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1]) + callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1)); Ecs.TableUnlock(it); } @@ -46,21 +38,13 @@ public static void Each(Iter it, Ecs.EachEntityRefCallback callb { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); + int step0 = it.Step(0); int step1 = it.Step(1); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1)); Ecs.TableUnlock(it); } @@ -75,21 +59,13 @@ public static void Each(Iter it, Ecs.EachIterRefCallback callbac { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); + int step0 = it.Step(0); int step1 = it.Step(1); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1]) + callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1)); Ecs.TableUnlock(it); } @@ -104,21 +80,13 @@ public static void Each(Iter it, delegate* callbac { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); + int step0 = it.Step(0); int step1 = it.Step(1); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1]) + callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1)); Ecs.TableUnlock(it); } @@ -133,21 +101,13 @@ public static void Each(Iter it, delegate* { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); + int step0 = it.Step(0); int step1 = it.Step(1); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1)); Ecs.TableUnlock(it); } @@ -162,21 +122,13 @@ public static void Each(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); + int step0 = it.Step(0); int step1 = it.Step(1); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1]) + callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1)); Ecs.TableUnlock(it); } @@ -191,21 +143,13 @@ public static void Each(Iter it, Ecs.EachPointerCallback callbac { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); + int step0 = it.Step(0); int step1 = it.Step(1); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(&pointer0[i], &pointer1[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); - for (int i = 0; i < count; i++) - callback(&pointer0[i * step0], &pointer1[i * step1]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1]) + callback((T0*)pointer0, (T1*)pointer1); Ecs.TableUnlock(it); } @@ -220,21 +164,13 @@ public static void Each(Iter it, Ecs.EachEntityPointerCallback c { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); + int step0 = it.Step(0); int step1 = it.Step(1); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1); Ecs.TableUnlock(it); } @@ -249,21 +185,13 @@ public static void Each(Iter it, Ecs.EachIterPointerCallback cal { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); + int step0 = it.Step(0); int step1 = it.Step(1); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i], &pointer1[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i * step0], &pointer1[i * step1]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1]) + callback(it, i, (T0*)pointer0, (T1*)pointer1); Ecs.TableUnlock(it); } @@ -278,21 +206,13 @@ public static void Each(Iter it, delegate* callback) { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); + int step0 = it.Step(0); int step1 = it.Step(1); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(&pointer0[i], &pointer1[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); - for (int i = 0; i < count; i++) - callback(&pointer0[i * step0], &pointer1[i * step1]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1]) + callback((T0*)pointer0, (T1*)pointer1); Ecs.TableUnlock(it); } @@ -307,21 +227,13 @@ public static void Each(Iter it, delegate* callb { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); + int step0 = it.Step(0); int step1 = it.Step(1); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1); Ecs.TableUnlock(it); } @@ -336,21 +248,13 @@ public static void Each(Iter it, delegate* ca { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); + int step0 = it.Step(0); int step1 = it.Step(1); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i], &pointer1[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i * step0], &pointer1[i * step1]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1]) + callback(it, i, (T0*)pointer0, (T1*)pointer1); Ecs.TableUnlock(it); } diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T3.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T3.g.cs index f81c137b..766bd6a7 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T3.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T3.g.cs @@ -17,21 +17,13 @@ public static void Each(Iter it, Ecs.EachRefCallback cal { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2]) + callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2)); Ecs.TableUnlock(it); } @@ -46,21 +38,13 @@ public static void Each(Iter it, Ecs.EachEntityRefCallbackcount; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2)); Ecs.TableUnlock(it); } @@ -75,21 +59,13 @@ public static void Each(Iter it, Ecs.EachIterRefCallback { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2]) + callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2)); Ecs.TableUnlock(it); } @@ -104,21 +80,13 @@ public static void Each(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2]) + callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2)); Ecs.TableUnlock(it); } @@ -133,21 +101,13 @@ public static void Each(Iter it, delegate*count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2)); Ecs.TableUnlock(it); } @@ -162,21 +122,13 @@ public static void Each(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2]) + callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2)); Ecs.TableUnlock(it); } @@ -191,21 +143,13 @@ public static void Each(Iter it, Ecs.EachPointerCallback { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(&pointer0[i], &pointer1[i], &pointer2[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); - for (int i = 0; i < count; i++) - callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2]) + callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2); Ecs.TableUnlock(it); } @@ -220,21 +164,13 @@ public static void Each(Iter it, Ecs.EachEntityPointerCallbackcount; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2); Ecs.TableUnlock(it); } @@ -249,21 +185,13 @@ public static void Each(Iter it, Ecs.EachIterPointerCallbackcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2]) + callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2); Ecs.TableUnlock(it); } @@ -278,21 +206,13 @@ public static void Each(Iter it, delegate* call { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(&pointer0[i], &pointer1[i], &pointer2[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); - for (int i = 0; i < count; i++) - callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2]) + callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2); Ecs.TableUnlock(it); } @@ -307,21 +227,13 @@ public static void Each(Iter it, delegate*count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2); Ecs.TableUnlock(it); } @@ -336,21 +248,13 @@ public static void Each(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2]) + callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2); Ecs.TableUnlock(it); } diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T4.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T4.g.cs index 1735bc22..8987a2a5 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T4.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T4.g.cs @@ -17,21 +17,13 @@ public static void Each(Iter it, Ecs.EachRefCallbackcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3]) + callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3)); Ecs.TableUnlock(it); } @@ -46,21 +38,13 @@ public static void Each(Iter it, Ecs.EachEntityRefCallbackcount; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3)); Ecs.TableUnlock(it); } @@ -75,21 +59,13 @@ public static void Each(Iter it, Ecs.EachIterRefCallbackcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3]) + callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3)); Ecs.TableUnlock(it); } @@ -104,21 +80,13 @@ public static void Each(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3]) + callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3)); Ecs.TableUnlock(it); } @@ -133,21 +101,13 @@ public static void Each(Iter it, delegate*count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3)); Ecs.TableUnlock(it); } @@ -162,21 +122,13 @@ public static void Each(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3]) + callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3)); Ecs.TableUnlock(it); } @@ -191,21 +143,13 @@ public static void Each(Iter it, Ecs.EachPointerCallbackcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); - for (int i = 0; i < count; i++) - callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3]) + callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3); Ecs.TableUnlock(it); } @@ -220,21 +164,13 @@ public static void Each(Iter it, Ecs.EachEntityPointerCallbackcount; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3); Ecs.TableUnlock(it); } @@ -249,21 +185,13 @@ public static void Each(Iter it, Ecs.EachIterPointerCallbackcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3]) + callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3); Ecs.TableUnlock(it); } @@ -278,21 +206,13 @@ public static void Each(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); - for (int i = 0; i < count; i++) - callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3]) + callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3); Ecs.TableUnlock(it); } @@ -307,21 +227,13 @@ public static void Each(Iter it, delegate*count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3); Ecs.TableUnlock(it); } @@ -336,21 +248,13 @@ public static void Each(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3]) + callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3); Ecs.TableUnlock(it); } diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T5.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T5.g.cs index ff5c40f0..6177839d 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T5.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T5.g.cs @@ -17,21 +17,13 @@ public static void Each(Iter it, Ecs.EachRefCallbackcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4]) + callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4)); Ecs.TableUnlock(it); } @@ -46,21 +38,13 @@ public static void Each(Iter it, Ecs.EachEntityRefCallbackcount; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4)); Ecs.TableUnlock(it); } @@ -75,21 +59,13 @@ public static void Each(Iter it, Ecs.EachIterRefCallbackcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4]) + callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4)); Ecs.TableUnlock(it); } @@ -104,21 +80,13 @@ public static void Each(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4]) + callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4)); Ecs.TableUnlock(it); } @@ -133,21 +101,13 @@ public static void Each(Iter it, delegate*count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4)); Ecs.TableUnlock(it); } @@ -162,21 +122,13 @@ public static void Each(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4]) + callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4)); Ecs.TableUnlock(it); } @@ -191,21 +143,13 @@ public static void Each(Iter it, Ecs.EachPointerCallbackcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); - for (int i = 0; i < count; i++) - callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4]) + callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4); Ecs.TableUnlock(it); } @@ -220,21 +164,13 @@ public static void Each(Iter it, Ecs.EachEntityPointerCallba { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4); Ecs.TableUnlock(it); } @@ -249,21 +185,13 @@ public static void Each(Iter it, Ecs.EachIterPointerCallback { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4]) + callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4); Ecs.TableUnlock(it); } @@ -278,21 +206,13 @@ public static void Each(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); - for (int i = 0; i < count; i++) - callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4]) + callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4); Ecs.TableUnlock(it); } @@ -307,21 +227,13 @@ public static void Each(Iter it, delegate*count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4); Ecs.TableUnlock(it); } @@ -336,21 +248,13 @@ public static void Each(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4]) + callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4); Ecs.TableUnlock(it); } diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T6.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T6.g.cs index 2fb6b823..a7c357b6 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T6.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T6.g.cs @@ -17,21 +17,13 @@ public static void Each(Iter it, Ecs.EachRefCallbackcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5]) + callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5)); Ecs.TableUnlock(it); } @@ -46,21 +38,13 @@ public static void Each(Iter it, Ecs.EachEntityRefCallba { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5)); Ecs.TableUnlock(it); } @@ -75,21 +59,13 @@ public static void Each(Iter it, Ecs.EachIterRefCallback { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5]) + callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5)); Ecs.TableUnlock(it); } @@ -104,21 +80,13 @@ public static void Each(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5]) + callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5)); Ecs.TableUnlock(it); } @@ -133,21 +101,13 @@ public static void Each(Iter it, delegate*count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5)); Ecs.TableUnlock(it); } @@ -162,21 +122,13 @@ public static void Each(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5]) + callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5)); Ecs.TableUnlock(it); } @@ -191,21 +143,13 @@ public static void Each(Iter it, Ecs.EachPointerCallback { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); - for (int i = 0; i < count; i++) - callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5]) + callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5); Ecs.TableUnlock(it); } @@ -220,21 +164,13 @@ public static void Each(Iter it, Ecs.EachEntityPointerCa { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5); Ecs.TableUnlock(it); } @@ -249,21 +185,13 @@ public static void Each(Iter it, Ecs.EachIterPointerCall { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5]) + callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5); Ecs.TableUnlock(it); } @@ -278,21 +206,13 @@ public static void Each(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); - for (int i = 0; i < count; i++) - callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5]) + callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5); Ecs.TableUnlock(it); } @@ -307,21 +227,13 @@ public static void Each(Iter it, delegate*count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5); Ecs.TableUnlock(it); } @@ -336,21 +248,13 @@ public static void Each(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5]) + callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5); Ecs.TableUnlock(it); } diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T7.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T7.g.cs index 59e2c344..186000ea 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T7.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T7.g.cs @@ -17,21 +17,13 @@ public static void Each(Iter it, Ecs.EachRefCallback { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6]) + callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6)); Ecs.TableUnlock(it); } @@ -46,21 +38,13 @@ public static void Each(Iter it, Ecs.EachEntityRefCa { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6)); Ecs.TableUnlock(it); } @@ -75,21 +59,13 @@ public static void Each(Iter it, Ecs.EachIterRefCall { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6]) + callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6)); Ecs.TableUnlock(it); } @@ -104,21 +80,13 @@ public static void Each(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6]) + callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6)); Ecs.TableUnlock(it); } @@ -133,21 +101,13 @@ public static void Each(Iter it, delegate*count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6)); Ecs.TableUnlock(it); } @@ -162,21 +122,13 @@ public static void Each(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6]) + callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6)); Ecs.TableUnlock(it); } @@ -191,21 +143,13 @@ public static void Each(Iter it, Ecs.EachPointerCall { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); - for (int i = 0; i < count; i++) - callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6]) + callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6); Ecs.TableUnlock(it); } @@ -220,21 +164,13 @@ public static void Each(Iter it, Ecs.EachEntityPoint { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6); Ecs.TableUnlock(it); } @@ -249,21 +185,13 @@ public static void Each(Iter it, Ecs.EachIterPointer { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6]) + callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6); Ecs.TableUnlock(it); } @@ -278,21 +206,13 @@ public static void Each(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); - for (int i = 0; i < count; i++) - callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6]) + callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6); Ecs.TableUnlock(it); } @@ -307,21 +227,13 @@ public static void Each(Iter it, delegate*count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6); Ecs.TableUnlock(it); } @@ -336,21 +248,13 @@ public static void Each(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6]) + callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6); Ecs.TableUnlock(it); } diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T8.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T8.g.cs index 6c3ef637..8bb05d21 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T8.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T8.g.cs @@ -17,21 +17,13 @@ public static void Each(Iter it, Ecs.EachRefCall { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7]) + callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7)); Ecs.TableUnlock(it); } @@ -46,21 +38,13 @@ public static void Each(Iter it, Ecs.EachEntityR { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7)); Ecs.TableUnlock(it); } @@ -75,21 +59,13 @@ public static void Each(Iter it, Ecs.EachIterRef { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7]) + callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7)); Ecs.TableUnlock(it); } @@ -104,21 +80,13 @@ public static void Each(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7]) + callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7)); Ecs.TableUnlock(it); } @@ -133,21 +101,13 @@ public static void Each(Iter it, delegate*count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7)); Ecs.TableUnlock(it); } @@ -162,21 +122,13 @@ public static void Each(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7]) + callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7)); Ecs.TableUnlock(it); } @@ -191,21 +143,13 @@ public static void Each(Iter it, Ecs.EachPointer { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); - for (int i = 0; i < count; i++) - callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7]) + callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7); Ecs.TableUnlock(it); } @@ -220,21 +164,13 @@ public static void Each(Iter it, Ecs.EachEntityP { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7); Ecs.TableUnlock(it); } @@ -249,21 +185,13 @@ public static void Each(Iter it, Ecs.EachIterPoi { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7]) + callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7); Ecs.TableUnlock(it); } @@ -278,21 +206,13 @@ public static void Each(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); - for (int i = 0; i < count; i++) - callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7]) + callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7); Ecs.TableUnlock(it); } @@ -307,21 +227,13 @@ public static void Each(Iter it, delegate*count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7); Ecs.TableUnlock(it); } @@ -336,21 +248,13 @@ public static void Each(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7]) + callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7); Ecs.TableUnlock(it); } diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T9.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T9.g.cs index 1f03d6a5..6f91c90c 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T9.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Each/Iterator/T9.g.cs @@ -17,21 +17,13 @@ public static void Each(Iter it, Ecs.EachRef { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8]) + callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8)); Ecs.TableUnlock(it); } @@ -46,21 +38,13 @@ public static void Each(Iter it, Ecs.EachEnt { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8)); Ecs.TableUnlock(it); } @@ -75,21 +59,13 @@ public static void Each(Iter it, Ecs.EachIte { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8]) + callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8)); Ecs.TableUnlock(it); } @@ -104,21 +80,13 @@ public static void Each(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); - for (int i = 0; i < count; i++) - callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8]) + callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8)); Ecs.TableUnlock(it); } @@ -133,21 +101,13 @@ public static void Each(Iter it, delegate*count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8)); Ecs.TableUnlock(it); } @@ -162,21 +122,13 @@ public static void Each(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i])); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); - for (int i = 0; i < count; i++) - callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8])); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8]) + callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8)); Ecs.TableUnlock(it); } @@ -191,21 +143,13 @@ public static void Each(Iter it, Ecs.EachPoi { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); - for (int i = 0; i < count; i++) - callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8]) + callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8); Ecs.TableUnlock(it); } @@ -220,21 +164,13 @@ public static void Each(Iter it, Ecs.EachEnt { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8); Ecs.TableUnlock(it); } @@ -249,21 +185,13 @@ public static void Each(Iter it, Ecs.EachIte { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8]) + callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8); Ecs.TableUnlock(it); } @@ -278,21 +206,13 @@ public static void Each(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); - for (int i = 0; i < count; i++) - callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8]) + callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8); Ecs.TableUnlock(it); } @@ -307,21 +227,13 @@ public static void Each(Iter it, delegate*count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); - for (int i = 0; i < count; i++) - callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8]) + callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8); Ecs.TableUnlock(it); } @@ -336,21 +248,13 @@ public static void Each(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); Ecs.TableLock(it); - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i]); - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); - for (int i = 0; i < count; i++) - callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8]); - } + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8]) + callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8); Ecs.TableUnlock(it); } diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T1.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T1.g.cs index 28886083..4ba025c4 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T1.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T1.g.cs @@ -17,34 +17,20 @@ public static Entity Find(Iter it, Ecs.FindRefCallback callback) { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); + byte* pointer0 = (byte*)it.GetPointer(0); + int step0 = it.Step(0); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0]) { - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i * step0]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(ref Managed.GetTypeRef(pointer0))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -62,34 +48,20 @@ public static Entity Find(Iter it, Ecs.FindEntityRefCallback callback) { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); + byte* pointer0 = (byte*)it.GetPointer(0); + int step0 = it.Step(0); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0]) { - int step0 = it.Step(0); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -107,34 +79,20 @@ public static Entity Find(Iter it, Ecs.FindIterRefCallback callback) { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); + byte* pointer0 = (byte*)it.GetPointer(0); + int step0 = it.Step(0); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0]) { - int step0 = it.Step(0); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, ref Managed.GetTypeRef(pointer0))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -152,34 +110,20 @@ public static Entity Find(Iter it, delegate* callback) { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); + byte* pointer0 = (byte*)it.GetPointer(0); + int step0 = it.Step(0); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0]) { - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i * step0]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(ref Managed.GetTypeRef(pointer0))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -197,34 +141,20 @@ public static Entity Find(Iter it, delegate* callback) { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); + byte* pointer0 = (byte*)it.GetPointer(0); + int step0 = it.Step(0); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0]) { - int step0 = it.Step(0); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -242,34 +172,20 @@ public static Entity Find(Iter it, delegate* callba { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); + byte* pointer0 = (byte*)it.GetPointer(0); + int step0 = it.Step(0); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0]) { - int step0 = it.Step(0); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, ref Managed.GetTypeRef(pointer0))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -287,34 +203,20 @@ public static Entity Find(Iter it, Ecs.FindPointerCallback callback) { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); + byte* pointer0 = (byte*)it.GetPointer(0); + int step0 = it.Step(0); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0]) { - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i * step0])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback((T0*)pointer0)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -332,34 +234,20 @@ public static Entity Find(Iter it, Ecs.FindEntityPointerCallback callbac { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); + byte* pointer0 = (byte*)it.GetPointer(0); + int step0 = it.Step(0); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0]) { - int step0 = it.Step(0); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -377,34 +265,20 @@ public static Entity Find(Iter it, Ecs.FindIterPointerCallback callback) { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); + byte* pointer0 = (byte*)it.GetPointer(0); + int step0 = it.Step(0); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0]) { - int step0 = it.Step(0); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i * step0])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, (T0*)pointer0)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -422,34 +296,20 @@ public static Entity Find(Iter it, delegate* callback) { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); + byte* pointer0 = (byte*)it.GetPointer(0); + int step0 = it.Step(0); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0]) { - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i * step0])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback((T0*)pointer0)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -467,34 +327,20 @@ public static Entity Find(Iter it, delegate* callback) { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); + byte* pointer0 = (byte*)it.GetPointer(0); + int step0 = it.Step(0); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0]) { - int step0 = it.Step(0); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -512,34 +358,20 @@ public static Entity Find(Iter it, delegate* callback) { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); + byte* pointer0 = (byte*)it.GetPointer(0); + int step0 = it.Step(0); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0]) { - int step0 = it.Step(0); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i * step0])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, (T0*)pointer0)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T10.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T10.g.cs index a09f4ea8..275adb7d 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T10.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T10.g.cs @@ -17,34 +17,20 @@ public static Entity Find(Iter it, Ecs.F { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9]) { - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -62,34 +48,20 @@ public static Entity Find(Iter it, Ecs.F { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -107,34 +79,20 @@ public static Entity Find(Iter it, Ecs.F { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -152,34 +110,20 @@ public static Entity Find(Iter it, deleg { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9]) { - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -197,34 +141,20 @@ public static Entity Find(Iter it, deleg { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -242,34 +172,20 @@ public static Entity Find(Iter it, deleg { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -287,34 +203,20 @@ public static Entity Find(Iter it, Ecs.F { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9]) { - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -332,34 +234,20 @@ public static Entity Find(Iter it, Ecs.F { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -377,34 +265,20 @@ public static Entity Find(Iter it, Ecs.F { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -422,34 +296,20 @@ public static Entity Find(Iter it, deleg { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9]) { - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -467,34 +327,20 @@ public static Entity Find(Iter it, deleg { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -512,34 +358,20 @@ public static Entity Find(Iter it, deleg { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T11.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T11.g.cs index dd0ac8c0..e4dc67f8 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T11.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T11.g.cs @@ -17,34 +17,20 @@ public static Entity Find(Iter it, { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10]) { - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -62,34 +48,20 @@ public static Entity Find(Iter it, { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -107,34 +79,20 @@ public static Entity Find(Iter it, { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -152,34 +110,20 @@ public static Entity Find(Iter it, { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10]) { - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -197,34 +141,20 @@ public static Entity Find(Iter it, { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -242,34 +172,20 @@ public static Entity Find(Iter it, { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -287,34 +203,20 @@ public static Entity Find(Iter it, { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10]) { - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -332,34 +234,20 @@ public static Entity Find(Iter it, { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -377,34 +265,20 @@ public static Entity Find(Iter it, { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -422,34 +296,20 @@ public static Entity Find(Iter it, { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10]) { - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -467,34 +327,20 @@ public static Entity Find(Iter it, { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -512,34 +358,20 @@ public static Entity Find(Iter it, { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T12.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T12.g.cs index 8301700b..4bc15f05 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T12.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T12.g.cs @@ -17,34 +17,20 @@ public static Entity Find(Iter { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11]) { - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -62,34 +48,20 @@ public static Entity Find(Iter { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -107,34 +79,20 @@ public static Entity Find(Iter { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -152,34 +110,20 @@ public static Entity Find(Iter { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11]) { - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -197,34 +141,20 @@ public static Entity Find(Iter { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -242,34 +172,20 @@ public static Entity Find(Iter { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -287,34 +203,20 @@ public static Entity Find(Iter { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11]) { - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -332,34 +234,20 @@ public static Entity Find(Iter { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -377,34 +265,20 @@ public static Entity Find(Iter { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -422,34 +296,20 @@ public static Entity Find(Iter { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11]) { - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -467,34 +327,20 @@ public static Entity Find(Iter { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -512,34 +358,20 @@ public static Entity Find(Iter { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T13.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T13.g.cs index 1a96f56a..75b4cdc7 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T13.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T13.g.cs @@ -17,34 +17,20 @@ public static Entity Find { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12]) { - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -62,34 +48,20 @@ public static Entity Find { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -107,34 +79,20 @@ public static Entity Find { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -152,34 +110,20 @@ public static Entity Find { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12]) { - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -197,34 +141,20 @@ public static Entity Find { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -242,34 +172,20 @@ public static Entity Find { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -287,34 +203,20 @@ public static Entity Find { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12]) { - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -332,34 +234,20 @@ public static Entity Find { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -377,34 +265,20 @@ public static Entity Find { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -422,34 +296,20 @@ public static Entity Find { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12]) { - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -467,34 +327,20 @@ public static Entity Find { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -512,34 +358,20 @@ public static Entity Find { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T14.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T14.g.cs index ffea2a1e..ef58d99b 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T14.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T14.g.cs @@ -17,34 +17,20 @@ public static Entity Findcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13]) { - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -62,34 +48,20 @@ public static Entity Findcount; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -107,34 +79,20 @@ public static Entity Findcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -152,34 +110,20 @@ public static Entity Findcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13]) { - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -197,34 +141,20 @@ public static Entity Findcount; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -242,34 +172,20 @@ public static Entity Findcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -287,34 +203,20 @@ public static Entity Findcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13]) { - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -332,34 +234,20 @@ public static Entity Findcount; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -377,34 +265,20 @@ public static Entity Findcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -422,34 +296,20 @@ public static Entity Findcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13]) { - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -467,34 +327,20 @@ public static Entity Findcount; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -512,34 +358,20 @@ public static Entity Findcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T15.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T15.g.cs index 361df415..1410fcb6 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T15.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T15.g.cs @@ -17,34 +17,20 @@ public static Entity Findcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14]) { - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i]), ref Managed.GetTypeRef(&pointer14[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13]), ref Managed.GetTypeRef(&pointer14[i * step14]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13), ref Managed.GetTypeRef(pointer14))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -62,34 +48,20 @@ public static Entity Findcount; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i]), ref Managed.GetTypeRef(&pointer14[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13]), ref Managed.GetTypeRef(&pointer14[i * step14]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13), ref Managed.GetTypeRef(pointer14))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -107,34 +79,20 @@ public static Entity Findcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i]), ref Managed.GetTypeRef(&pointer14[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13]), ref Managed.GetTypeRef(&pointer14[i * step14]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13), ref Managed.GetTypeRef(pointer14))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -152,34 +110,20 @@ public static Entity Findcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14]) { - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i]), ref Managed.GetTypeRef(&pointer14[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13]), ref Managed.GetTypeRef(&pointer14[i * step14]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13), ref Managed.GetTypeRef(pointer14))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -197,34 +141,20 @@ public static Entity Findcount; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i]), ref Managed.GetTypeRef(&pointer14[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13]), ref Managed.GetTypeRef(&pointer14[i * step14]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13), ref Managed.GetTypeRef(pointer14))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -242,34 +172,20 @@ public static Entity Findcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i]), ref Managed.GetTypeRef(&pointer14[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13]), ref Managed.GetTypeRef(&pointer14[i * step14]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13), ref Managed.GetTypeRef(pointer14))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -287,34 +203,20 @@ public static Entity Findcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14]) { - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i], &pointer14[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13], &pointer14[i * step14])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13, (T14*)pointer14)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -332,34 +234,20 @@ public static Entity Findcount; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i], &pointer14[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13], &pointer14[i * step14])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13, (T14*)pointer14)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -377,34 +265,20 @@ public static Entity Findcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i], &pointer14[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13], &pointer14[i * step14])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13, (T14*)pointer14)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -422,34 +296,20 @@ public static Entity Findcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14]) { - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i], &pointer14[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13], &pointer14[i * step14])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13, (T14*)pointer14)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -467,34 +327,20 @@ public static Entity Findcount; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i], &pointer14[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13], &pointer14[i * step14])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13, (T14*)pointer14)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -512,34 +358,20 @@ public static Entity Findcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i], &pointer14[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13], &pointer14[i * step14])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13, (T14*)pointer14)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T16.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T16.g.cs index 121ac3b9..77f0d473 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T16.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T16.g.cs @@ -17,34 +17,20 @@ public static Entity Findcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); T15* pointer15 = it.GetPointer(15); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); byte* pointer15 = (byte*)it.GetPointer(15); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14], pointer15 = &pointer15[step15]) { - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i]), ref Managed.GetTypeRef(&pointer14[i]), ref Managed.GetTypeRef(&pointer15[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13]), ref Managed.GetTypeRef(&pointer14[i * step14]), ref Managed.GetTypeRef(&pointer15[i * step15]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13), ref Managed.GetTypeRef(pointer14), ref Managed.GetTypeRef(pointer15))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -62,34 +48,20 @@ public static Entity Findcount; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); T15* pointer15 = it.GetPointer(15); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); byte* pointer15 = (byte*)it.GetPointer(15); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i]), ref Managed.GetTypeRef(&pointer14[i]), ref Managed.GetTypeRef(&pointer15[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14], pointer15 = &pointer15[step15]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13]), ref Managed.GetTypeRef(&pointer14[i * step14]), ref Managed.GetTypeRef(&pointer15[i * step15]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13), ref Managed.GetTypeRef(pointer14), ref Managed.GetTypeRef(pointer15))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -107,34 +79,20 @@ public static Entity Findcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); T15* pointer15 = it.GetPointer(15); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); byte* pointer15 = (byte*)it.GetPointer(15); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i]), ref Managed.GetTypeRef(&pointer14[i]), ref Managed.GetTypeRef(&pointer15[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14], pointer15 = &pointer15[step15]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13]), ref Managed.GetTypeRef(&pointer14[i * step14]), ref Managed.GetTypeRef(&pointer15[i * step15]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13), ref Managed.GetTypeRef(pointer14), ref Managed.GetTypeRef(pointer15))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -152,34 +110,20 @@ public static Entity Findcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); T15* pointer15 = it.GetPointer(15); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); byte* pointer15 = (byte*)it.GetPointer(15); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14], pointer15 = &pointer15[step15]) { - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i]), ref Managed.GetTypeRef(&pointer14[i]), ref Managed.GetTypeRef(&pointer15[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13]), ref Managed.GetTypeRef(&pointer14[i * step14]), ref Managed.GetTypeRef(&pointer15[i * step15]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13), ref Managed.GetTypeRef(pointer14), ref Managed.GetTypeRef(pointer15))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -197,34 +141,20 @@ public static Entity Findcount; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); T15* pointer15 = it.GetPointer(15); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); byte* pointer15 = (byte*)it.GetPointer(15); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i]), ref Managed.GetTypeRef(&pointer14[i]), ref Managed.GetTypeRef(&pointer15[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14], pointer15 = &pointer15[step15]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13]), ref Managed.GetTypeRef(&pointer14[i * step14]), ref Managed.GetTypeRef(&pointer15[i * step15]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13), ref Managed.GetTypeRef(pointer14), ref Managed.GetTypeRef(pointer15))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -242,34 +172,20 @@ public static Entity Findcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); T15* pointer15 = it.GetPointer(15); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); byte* pointer15 = (byte*)it.GetPointer(15); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]), ref Managed.GetTypeRef(&pointer9[i]), ref Managed.GetTypeRef(&pointer10[i]), ref Managed.GetTypeRef(&pointer11[i]), ref Managed.GetTypeRef(&pointer12[i]), ref Managed.GetTypeRef(&pointer13[i]), ref Managed.GetTypeRef(&pointer14[i]), ref Managed.GetTypeRef(&pointer15[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14], pointer15 = &pointer15[step15]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]), ref Managed.GetTypeRef(&pointer9[i * step9]), ref Managed.GetTypeRef(&pointer10[i * step10]), ref Managed.GetTypeRef(&pointer11[i * step11]), ref Managed.GetTypeRef(&pointer12[i * step12]), ref Managed.GetTypeRef(&pointer13[i * step13]), ref Managed.GetTypeRef(&pointer14[i * step14]), ref Managed.GetTypeRef(&pointer15[i * step15]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8), ref Managed.GetTypeRef(pointer9), ref Managed.GetTypeRef(pointer10), ref Managed.GetTypeRef(pointer11), ref Managed.GetTypeRef(pointer12), ref Managed.GetTypeRef(pointer13), ref Managed.GetTypeRef(pointer14), ref Managed.GetTypeRef(pointer15))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -287,34 +203,20 @@ public static Entity Findcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); T15* pointer15 = it.GetPointer(15); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); byte* pointer15 = (byte*)it.GetPointer(15); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14], pointer15 = &pointer15[step15]) { - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i], &pointer14[i], &pointer15[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13], &pointer14[i * step14], &pointer15[i * step15])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13, (T14*)pointer14, (T15*)pointer15)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -332,34 +234,20 @@ public static Entity Findcount; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); T15* pointer15 = it.GetPointer(15); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); byte* pointer15 = (byte*)it.GetPointer(15); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i], &pointer14[i], &pointer15[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14], pointer15 = &pointer15[step15]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13], &pointer14[i * step14], &pointer15[i * step15])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13, (T14*)pointer14, (T15*)pointer15)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -377,34 +265,20 @@ public static Entity Findcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); T15* pointer15 = it.GetPointer(15); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); byte* pointer15 = (byte*)it.GetPointer(15); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i], &pointer14[i], &pointer15[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14], pointer15 = &pointer15[step15]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13], &pointer14[i * step14], &pointer15[i * step15])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13, (T14*)pointer14, (T15*)pointer15)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -422,34 +296,20 @@ public static Entity Findcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); T15* pointer15 = it.GetPointer(15); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); byte* pointer15 = (byte*)it.GetPointer(15); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14], pointer15 = &pointer15[step15]) { - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i], &pointer14[i], &pointer15[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13], &pointer14[i * step14], &pointer15[i * step15])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13, (T14*)pointer14, (T15*)pointer15)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -467,34 +327,20 @@ public static Entity Findcount; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); T15* pointer15 = it.GetPointer(15); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); byte* pointer15 = (byte*)it.GetPointer(15); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i], &pointer14[i], &pointer15[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14], pointer15 = &pointer15[step15]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13], &pointer14[i * step14], &pointer15[i * step15])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13, (T14*)pointer14, (T15*)pointer15)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -512,34 +358,20 @@ public static Entity Findcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); T9* pointer9 = it.GetPointer(9); T10* pointer10 = it.GetPointer(10); T11* pointer11 = it.GetPointer(11); T12* pointer12 = it.GetPointer(12); T13* pointer13 = it.GetPointer(13); T14* pointer14 = it.GetPointer(14); T15* pointer15 = it.GetPointer(15); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); byte* pointer9 = (byte*)it.GetPointer(9); byte* pointer10 = (byte*)it.GetPointer(10); byte* pointer11 = (byte*)it.GetPointer(11); byte* pointer12 = (byte*)it.GetPointer(12); byte* pointer13 = (byte*)it.GetPointer(13); byte* pointer14 = (byte*)it.GetPointer(14); byte* pointer15 = (byte*)it.GetPointer(15); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i], &pointer9[i], &pointer10[i], &pointer11[i], &pointer12[i], &pointer13[i], &pointer14[i], &pointer15[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8], pointer9 = &pointer9[step9], pointer10 = &pointer10[step10], pointer11 = &pointer11[step11], pointer12 = &pointer12[step12], pointer13 = &pointer13[step13], pointer14 = &pointer14[step14], pointer15 = &pointer15[step15]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); int step9 = it.Step(9); int step10 = it.Step(10); int step11 = it.Step(11); int step12 = it.Step(12); int step13 = it.Step(13); int step14 = it.Step(14); int step15 = it.Step(15); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8], &pointer9[i * step9], &pointer10[i * step10], &pointer11[i * step11], &pointer12[i * step12], &pointer13[i * step13], &pointer14[i * step14], &pointer15[i * step15])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8, (T9*)pointer9, (T10*)pointer10, (T11*)pointer11, (T12*)pointer12, (T13*)pointer13, (T14*)pointer14, (T15*)pointer15)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T2.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T2.g.cs index 61a09d2e..ba881258 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T2.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T2.g.cs @@ -17,34 +17,20 @@ public static Entity Find(Iter it, Ecs.FindRefCallback callback) { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); + int step0 = it.Step(0); int step1 = it.Step(1); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1]) { - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -62,34 +48,20 @@ public static Entity Find(Iter it, Ecs.FindEntityRefCallback cal { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); + int step0 = it.Step(0); int step1 = it.Step(1); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1]) { - int step0 = it.Step(0); int step1 = it.Step(1); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -107,34 +79,20 @@ public static Entity Find(Iter it, Ecs.FindIterRefCallback callb { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); + int step0 = it.Step(0); int step1 = it.Step(1); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1]) { - int step0 = it.Step(0); int step1 = it.Step(1); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -152,34 +110,20 @@ public static Entity Find(Iter it, delegate* callb { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); + int step0 = it.Step(0); int step1 = it.Step(1); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1]) { - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -197,34 +141,20 @@ public static Entity Find(Iter it, delegate*count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); + int step0 = it.Step(0); int step1 = it.Step(1); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1]) { - int step0 = it.Step(0); int step1 = it.Step(1); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -242,34 +172,20 @@ public static Entity Find(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); + int step0 = it.Step(0); int step1 = it.Step(1); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1]) { - int step0 = it.Step(0); int step1 = it.Step(1); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -287,34 +203,20 @@ public static Entity Find(Iter it, Ecs.FindPointerCallback callb { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); + int step0 = it.Step(0); int step1 = it.Step(1); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1]) { - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i], &pointer1[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i * step0], &pointer1[i * step1])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback((T0*)pointer0, (T1*)pointer1)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -332,34 +234,20 @@ public static Entity Find(Iter it, Ecs.FindEntityPointerCallback { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); + int step0 = it.Step(0); int step1 = it.Step(1); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1]) { - int step0 = it.Step(0); int step1 = it.Step(1); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -377,34 +265,20 @@ public static Entity Find(Iter it, Ecs.FindIterPointerCallback c { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); + int step0 = it.Step(0); int step1 = it.Step(1); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i], &pointer1[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1]) { - int step0 = it.Step(0); int step1 = it.Step(1); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i * step0], &pointer1[i * step1])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, (T0*)pointer0, (T1*)pointer1)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -422,34 +296,20 @@ public static Entity Find(Iter it, delegate* callback) { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); + int step0 = it.Step(0); int step1 = it.Step(1); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1]) { - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i], &pointer1[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i * step0], &pointer1[i * step1])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback((T0*)pointer0, (T1*)pointer1)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -467,34 +327,20 @@ public static Entity Find(Iter it, delegate* cal { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); + int step0 = it.Step(0); int step1 = it.Step(1); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1]) { - int step0 = it.Step(0); int step1 = it.Step(1); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -512,34 +358,20 @@ public static Entity Find(Iter it, delegate* { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); + int step0 = it.Step(0); int step1 = it.Step(1); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i], &pointer1[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1]) { - int step0 = it.Step(0); int step1 = it.Step(1); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i * step0], &pointer1[i * step1])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, (T0*)pointer0, (T1*)pointer1)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T3.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T3.g.cs index 7b94b33f..70ccfb33 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T3.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T3.g.cs @@ -17,34 +17,20 @@ public static Entity Find(Iter it, Ecs.FindRefCallback c { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2]) { - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -62,34 +48,20 @@ public static Entity Find(Iter it, Ecs.FindEntityRefCallbackcount; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -107,34 +79,20 @@ public static Entity Find(Iter it, Ecs.FindIterRefCallbackcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -152,34 +110,20 @@ public static Entity Find(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2]) { - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -197,34 +141,20 @@ public static Entity Find(Iter it, delegate*count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -242,34 +172,20 @@ public static Entity Find(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -287,34 +203,20 @@ public static Entity Find(Iter it, Ecs.FindPointerCallbackcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2]) { - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i], &pointer1[i], &pointer2[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -332,34 +234,20 @@ public static Entity Find(Iter it, Ecs.FindEntityPointerCallbackcount; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -377,34 +265,20 @@ public static Entity Find(Iter it, Ecs.FindIterPointerCallbackcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -422,34 +296,20 @@ public static Entity Find(Iter it, delegate* ca { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2]) { - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i], &pointer1[i], &pointer2[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -467,34 +327,20 @@ public static Entity Find(Iter it, delegate*count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -512,34 +358,20 @@ public static Entity Find(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T4.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T4.g.cs index 8f5de93d..f304b0cf 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T4.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T4.g.cs @@ -17,34 +17,20 @@ public static Entity Find(Iter it, Ecs.FindRefCallbackcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3]) { - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -62,34 +48,20 @@ public static Entity Find(Iter it, Ecs.FindEntityRefCallbackcount; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -107,34 +79,20 @@ public static Entity Find(Iter it, Ecs.FindIterRefCallbackcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -152,34 +110,20 @@ public static Entity Find(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3]) { - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -197,34 +141,20 @@ public static Entity Find(Iter it, delegate*count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -242,34 +172,20 @@ public static Entity Find(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -287,34 +203,20 @@ public static Entity Find(Iter it, Ecs.FindPointerCallbackcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3]) { - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -332,34 +234,20 @@ public static Entity Find(Iter it, Ecs.FindEntityPointerCallback { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -377,34 +265,20 @@ public static Entity Find(Iter it, Ecs.FindIterPointerCallbackcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -422,34 +296,20 @@ public static Entity Find(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3]) { - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -467,34 +327,20 @@ public static Entity Find(Iter it, delegate*count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -512,34 +358,20 @@ public static Entity Find(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T5.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T5.g.cs index 9b16b2bd..1a3326fd 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T5.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T5.g.cs @@ -17,34 +17,20 @@ public static Entity Find(Iter it, Ecs.FindRefCallbackcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4]) { - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -62,34 +48,20 @@ public static Entity Find(Iter it, Ecs.FindEntityRefCallback { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -107,34 +79,20 @@ public static Entity Find(Iter it, Ecs.FindIterRefCallbackcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -152,34 +110,20 @@ public static Entity Find(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4]) { - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -197,34 +141,20 @@ public static Entity Find(Iter it, delegate*count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -242,34 +172,20 @@ public static Entity Find(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -287,34 +203,20 @@ public static Entity Find(Iter it, Ecs.FindPointerCallbackcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4]) { - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -332,34 +234,20 @@ public static Entity Find(Iter it, Ecs.FindEntityPointerCall { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -377,34 +265,20 @@ public static Entity Find(Iter it, Ecs.FindIterPointerCallba { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -422,34 +296,20 @@ public static Entity Find(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4]) { - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -467,34 +327,20 @@ public static Entity Find(Iter it, delegate*count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -512,34 +358,20 @@ public static Entity Find(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T6.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T6.g.cs index e8560feb..fc956b19 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T6.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T6.g.cs @@ -17,34 +17,20 @@ public static Entity Find(Iter it, Ecs.FindRefCallbackcount == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5]) { - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -62,34 +48,20 @@ public static Entity Find(Iter it, Ecs.FindEntityRefCall { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -107,34 +79,20 @@ public static Entity Find(Iter it, Ecs.FindIterRefCallba { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -152,34 +110,20 @@ public static Entity Find(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5]) { - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -197,34 +141,20 @@ public static Entity Find(Iter it, delegate*count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -242,34 +172,20 @@ public static Entity Find(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -287,34 +203,20 @@ public static Entity Find(Iter it, Ecs.FindPointerCallba { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5]) { - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -332,34 +234,20 @@ public static Entity Find(Iter it, Ecs.FindEntityPointer { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -377,34 +265,20 @@ public static Entity Find(Iter it, Ecs.FindIterPointerCa { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -422,34 +296,20 @@ public static Entity Find(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5]) { - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -467,34 +327,20 @@ public static Entity Find(Iter it, delegate*count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -512,34 +358,20 @@ public static Entity Find(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T7.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T7.g.cs index ff450655..8d6482df 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T7.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T7.g.cs @@ -17,34 +17,20 @@ public static Entity Find(Iter it, Ecs.FindRefCallba { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6]) { - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -62,34 +48,20 @@ public static Entity Find(Iter it, Ecs.FindEntityRef { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -107,34 +79,20 @@ public static Entity Find(Iter it, Ecs.FindIterRefCa { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -152,34 +110,20 @@ public static Entity Find(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6]) { - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -197,34 +141,20 @@ public static Entity Find(Iter it, delegate*count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -242,34 +172,20 @@ public static Entity Find(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -287,34 +203,20 @@ public static Entity Find(Iter it, Ecs.FindPointerCa { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6]) { - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -332,34 +234,20 @@ public static Entity Find(Iter it, Ecs.FindEntityPoi { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -377,34 +265,20 @@ public static Entity Find(Iter it, Ecs.FindIterPoint { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -422,34 +296,20 @@ public static Entity Find(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6]) { - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -467,34 +327,20 @@ public static Entity Find(Iter it, delegate*count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -512,34 +358,20 @@ public static Entity Find(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T8.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T8.g.cs index b932b22e..d1d0f073 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T8.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T8.g.cs @@ -17,34 +17,20 @@ public static Entity Find(Iter it, Ecs.FindRefCa { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7]) { - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -62,34 +48,20 @@ public static Entity Find(Iter it, Ecs.FindEntit { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -107,34 +79,20 @@ public static Entity Find(Iter it, Ecs.FindIterR { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -152,34 +110,20 @@ public static Entity Find(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7]) { - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -197,34 +141,20 @@ public static Entity Find(Iter it, delegate*count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -242,34 +172,20 @@ public static Entity Find(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -287,34 +203,20 @@ public static Entity Find(Iter it, Ecs.FindPoint { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7]) { - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -332,34 +234,20 @@ public static Entity Find(Iter it, Ecs.FindEntit { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -377,34 +265,20 @@ public static Entity Find(Iter it, Ecs.FindIterP { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -422,34 +296,20 @@ public static Entity Find(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7]) { - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -467,34 +327,20 @@ public static Entity Find(Iter it, delegate*count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -512,34 +358,20 @@ public static Entity Find(Iter it, delegate*count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T9.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T9.g.cs index ad1c8cb7..8f830ae6 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T9.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Invoker/Find/Iterator/T9.g.cs @@ -17,34 +17,20 @@ public static Entity Find(Iter it, Ecs.FindR { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8]) { - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -62,34 +48,20 @@ public static Entity Find(Iter it, Ecs.FindE { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -107,34 +79,20 @@ public static Entity Find(Iter it, Ecs.FindI { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -152,34 +110,20 @@ public static Entity Find(Iter it, delegate* { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8]) { - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); - for (int i = 0; i < count; i++) - { - if (!callback(ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -197,34 +141,20 @@ public static Entity Find(Iter it, delegate* { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -242,34 +172,20 @@ public static Entity Find(Iter it, delegate* { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i]), ref Managed.GetTypeRef(&pointer1[i]), ref Managed.GetTypeRef(&pointer2[i]), ref Managed.GetTypeRef(&pointer3[i]), ref Managed.GetTypeRef(&pointer4[i]), ref Managed.GetTypeRef(&pointer5[i]), ref Managed.GetTypeRef(&pointer6[i]), ref Managed.GetTypeRef(&pointer7[i]), ref Managed.GetTypeRef(&pointer8[i]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, ref Managed.GetTypeRef(&pointer0[i * step0]), ref Managed.GetTypeRef(&pointer1[i * step1]), ref Managed.GetTypeRef(&pointer2[i * step2]), ref Managed.GetTypeRef(&pointer3[i * step3]), ref Managed.GetTypeRef(&pointer4[i * step4]), ref Managed.GetTypeRef(&pointer5[i * step5]), ref Managed.GetTypeRef(&pointer6[i * step6]), ref Managed.GetTypeRef(&pointer7[i * step7]), ref Managed.GetTypeRef(&pointer8[i * step8]))) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, ref Managed.GetTypeRef(pointer0), ref Managed.GetTypeRef(pointer1), ref Managed.GetTypeRef(pointer2), ref Managed.GetTypeRef(pointer3), ref Managed.GetTypeRef(pointer4), ref Managed.GetTypeRef(pointer5), ref Managed.GetTypeRef(pointer6), ref Managed.GetTypeRef(pointer7), ref Managed.GetTypeRef(pointer8))) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -287,34 +203,20 @@ public static Entity Find(Iter it, Ecs.FindP { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8]) { - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -332,34 +234,20 @@ public static Entity Find(Iter it, Ecs.FindE { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -377,34 +265,20 @@ public static Entity Find(Iter it, Ecs.FindI { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -422,34 +296,20 @@ public static Entity Find(Iter it, delegate* { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8]) { - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else - { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); - for (int i = 0; i < count; i++) - { - if (!callback(&pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback((T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -467,34 +327,20 @@ public static Entity Find(Iter it, delegate* { int count = it.Handle->count; Ecs.Assert(it.Handle->count > 0, "No entities returned, use Iter() or Each() without the entity argument instead."); - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); - for (int i = 0; i < count; i++) - { - if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(new Entity(it.Handle->world, it.Handle->entities[i]), (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); @@ -512,34 +358,20 @@ public static Entity Find(Iter it, delegate* { int count = it.Handle->count == 0 && it.Handle->table == null ? 1 : it.Handle->count; - T0* pointer0 = it.GetPointer(0); T1* pointer1 = it.GetPointer(1); T2* pointer2 = it.GetPointer(2); T3* pointer3 = it.GetPointer(3); T4* pointer4 = it.GetPointer(4); T5* pointer5 = it.GetPointer(5); T6* pointer6 = it.GetPointer(6); T7* pointer7 = it.GetPointer(7); T8* pointer8 = it.GetPointer(8); + byte* pointer0 = (byte*)it.GetPointer(0); byte* pointer1 = (byte*)it.GetPointer(1); byte* pointer2 = (byte*)it.GetPointer(2); byte* pointer3 = (byte*)it.GetPointer(3); byte* pointer4 = (byte*)it.GetPointer(4); byte* pointer5 = (byte*)it.GetPointer(5); byte* pointer6 = (byte*)it.GetPointer(6); byte* pointer7 = (byte*)it.GetPointer(7); byte* pointer8 = (byte*)it.GetPointer(8); + int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); Ecs.TableLock(it); Entity result = default; - if (it.IsLinear()) - { - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i], &pointer1[i], &pointer2[i], &pointer3[i], &pointer4[i], &pointer5[i], &pointer6[i], &pointer7[i], &pointer8[i])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } - } - else + for (int i = 0; i < count; i++, pointer0 = &pointer0[step0], pointer1 = &pointer1[step1], pointer2 = &pointer2[step2], pointer3 = &pointer3[step3], pointer4 = &pointer4[step4], pointer5 = &pointer5[step5], pointer6 = &pointer6[step6], pointer7 = &pointer7[step7], pointer8 = &pointer8[step8]) { - int step0 = it.Step(0); int step1 = it.Step(1); int step2 = it.Step(2); int step3 = it.Step(3); int step4 = it.Step(4); int step5 = it.Step(5); int step6 = it.Step(6); int step7 = it.Step(7); int step8 = it.Step(8); - for (int i = 0; i < count; i++) - { - if (!callback(it, i, &pointer0[i * step0], &pointer1[i * step1], &pointer2[i * step2], &pointer3[i * step3], &pointer4[i * step4], &pointer5[i * step5], &pointer6[i * step6], &pointer7[i * step7], &pointer8[i * step8])) - continue; - - result = new Entity(it.Handle->world, it.Handle->entities[i]); - break; - } + if (!callback(it, i, (T0*)pointer0, (T1*)pointer1, (T2*)pointer2, (T3*)pointer3, (T4*)pointer4, (T5*)pointer5, (T6*)pointer6, (T7*)pointer7, (T8*)pointer8)) + continue; + + result = new Entity(it.Handle->world, it.Handle->entities[i]); + break; } Ecs.TableUnlock(it); diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T1.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T1.g.cs index 470e1df4..80079f08 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T1.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T1.g.cs @@ -180,6 +180,22 @@ public override int GetHashCode() } } +// Flecs.NET Extensions +public unsafe partial struct Query +{ + /// + public World World() + { + return _query.World(); + } + + /// + public World RealWorld() + { + return _query.RealWorld(); + } +} + // IIterableBase Interface public unsafe partial struct Query : IIterableBase { diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T10.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T10.g.cs index 8c2a363f..cf7cca17 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T10.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T10.g.cs @@ -180,6 +180,22 @@ public override int GetHashCode() } } +// Flecs.NET Extensions +public unsafe partial struct Query +{ + /// + public World World() + { + return _query.World(); + } + + /// + public World RealWorld() + { + return _query.RealWorld(); + } +} + // IIterableBase Interface public unsafe partial struct Query : IIterableBase { diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T11.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T11.g.cs index 81c72840..83dacf62 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T11.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T11.g.cs @@ -180,6 +180,22 @@ public override int GetHashCode() } } +// Flecs.NET Extensions +public unsafe partial struct Query +{ + /// + public World World() + { + return _query.World(); + } + + /// + public World RealWorld() + { + return _query.RealWorld(); + } +} + // IIterableBase Interface public unsafe partial struct Query : IIterableBase { diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T12.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T12.g.cs index f36a3974..576fa80b 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T12.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T12.g.cs @@ -180,6 +180,22 @@ public override int GetHashCode() } } +// Flecs.NET Extensions +public unsafe partial struct Query +{ + /// + public World World() + { + return _query.World(); + } + + /// + public World RealWorld() + { + return _query.RealWorld(); + } +} + // IIterableBase Interface public unsafe partial struct Query : IIterableBase { diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T13.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T13.g.cs index e5380b39..cbbfb8fc 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T13.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T13.g.cs @@ -180,6 +180,22 @@ public override int GetHashCode() } } +// Flecs.NET Extensions +public unsafe partial struct Query +{ + /// + public World World() + { + return _query.World(); + } + + /// + public World RealWorld() + { + return _query.RealWorld(); + } +} + // IIterableBase Interface public unsafe partial struct Query : IIterableBase { diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T14.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T14.g.cs index c261d26b..bc388223 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T14.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T14.g.cs @@ -180,6 +180,22 @@ public override int GetHashCode() } } +// Flecs.NET Extensions +public unsafe partial struct Query +{ + /// + public World World() + { + return _query.World(); + } + + /// + public World RealWorld() + { + return _query.RealWorld(); + } +} + // IIterableBase Interface public unsafe partial struct Query : IIterableBase { diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T15.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T15.g.cs index 7f847845..7d48bd89 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T15.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T15.g.cs @@ -180,6 +180,22 @@ public override int GetHashCode() } } +// Flecs.NET Extensions +public unsafe partial struct Query +{ + /// + public World World() + { + return _query.World(); + } + + /// + public World RealWorld() + { + return _query.RealWorld(); + } +} + // IIterableBase Interface public unsafe partial struct Query : IIterableBase { diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T16.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T16.g.cs index 8f9c2938..a028f133 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T16.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T16.g.cs @@ -180,6 +180,22 @@ public override int GetHashCode() } } +// Flecs.NET Extensions +public unsafe partial struct Query +{ + /// + public World World() + { + return _query.World(); + } + + /// + public World RealWorld() + { + return _query.RealWorld(); + } +} + // IIterableBase Interface public unsafe partial struct Query : IIterableBase { diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T2.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T2.g.cs index 3cba3028..f789c0a5 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T2.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T2.g.cs @@ -180,6 +180,22 @@ public override int GetHashCode() } } +// Flecs.NET Extensions +public unsafe partial struct Query +{ + /// + public World World() + { + return _query.World(); + } + + /// + public World RealWorld() + { + return _query.RealWorld(); + } +} + // IIterableBase Interface public unsafe partial struct Query : IIterableBase { diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T3.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T3.g.cs index b09928fd..7c696eaf 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T3.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T3.g.cs @@ -180,6 +180,22 @@ public override int GetHashCode() } } +// Flecs.NET Extensions +public unsafe partial struct Query +{ + /// + public World World() + { + return _query.World(); + } + + /// + public World RealWorld() + { + return _query.RealWorld(); + } +} + // IIterableBase Interface public unsafe partial struct Query : IIterableBase { diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T4.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T4.g.cs index db0fbf03..4ca3cac2 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T4.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T4.g.cs @@ -180,6 +180,22 @@ public override int GetHashCode() } } +// Flecs.NET Extensions +public unsafe partial struct Query +{ + /// + public World World() + { + return _query.World(); + } + + /// + public World RealWorld() + { + return _query.RealWorld(); + } +} + // IIterableBase Interface public unsafe partial struct Query : IIterableBase { diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T5.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T5.g.cs index 048aa823..53c3e804 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T5.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T5.g.cs @@ -180,6 +180,22 @@ public override int GetHashCode() } } +// Flecs.NET Extensions +public unsafe partial struct Query +{ + /// + public World World() + { + return _query.World(); + } + + /// + public World RealWorld() + { + return _query.RealWorld(); + } +} + // IIterableBase Interface public unsafe partial struct Query : IIterableBase { diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T6.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T6.g.cs index b9eba096..9c111d8d 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T6.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T6.g.cs @@ -180,6 +180,22 @@ public override int GetHashCode() } } +// Flecs.NET Extensions +public unsafe partial struct Query +{ + /// + public World World() + { + return _query.World(); + } + + /// + public World RealWorld() + { + return _query.RealWorld(); + } +} + // IIterableBase Interface public unsafe partial struct Query : IIterableBase { diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T7.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T7.g.cs index 44eb96e3..5636b3cc 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T7.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T7.g.cs @@ -180,6 +180,22 @@ public override int GetHashCode() } } +// Flecs.NET Extensions +public unsafe partial struct Query +{ + /// + public World World() + { + return _query.World(); + } + + /// + public World RealWorld() + { + return _query.RealWorld(); + } +} + // IIterableBase Interface public unsafe partial struct Query : IIterableBase { diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T8.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T8.g.cs index e5008d5a..9b4d127f 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T8.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T8.g.cs @@ -180,6 +180,22 @@ public override int GetHashCode() } } +// Flecs.NET Extensions +public unsafe partial struct Query +{ + /// + public World World() + { + return _query.World(); + } + + /// + public World RealWorld() + { + return _query.RealWorld(); + } +} + // IIterableBase Interface public unsafe partial struct Query : IIterableBase { diff --git a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T9.g.cs b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T9.g.cs index a26abcde..9a480e6e 100644 --- a/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T9.g.cs +++ b/src/Flecs.NET/Generated/Flecs.NET.Codegen/Query/Query/T9.g.cs @@ -180,6 +180,22 @@ public override int GetHashCode() } } +// Flecs.NET Extensions +public unsafe partial struct Query +{ + /// + public World World() + { + return _query.World(); + } + + /// + public World RealWorld() + { + return _query.RealWorld(); + } +} + // IIterableBase Interface public unsafe partial struct Query : IIterableBase {