Skip to content

Commit

Permalink
Refactor binding context into separate files and split delegate/point…
Browse files Browse the repository at this point in the history
…er logic
  • Loading branch information
BeanCheeseBurrito committed Aug 3, 2024
1 parent 24043d6 commit 523e471
Show file tree
Hide file tree
Showing 26 changed files with 1,904 additions and 1,605 deletions.
11 changes: 6 additions & 5 deletions src/Flecs.NET/Core/AlertBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using Flecs.NET.Core.BindingContext;
using Flecs.NET.Utilities;
using static Flecs.NET.Bindings.flecs;

Expand Down Expand Up @@ -65,8 +66,8 @@ public AlertBuilder(ecs_world_t* world, string name) : this(world)

ecs_entity_desc_t desc = default;
desc.name = nativeName;
desc.sep = BindingContext.DefaultSeparator;
desc.root_sep = BindingContext.DefaultSeparator;
desc.sep = Pointers.DefaultSeparator;
desc.root_sep = Pointers.DefaultSeparator;
Desc.entity = ecs_entity_init(World, &desc);
}

Expand All @@ -87,12 +88,12 @@ public Alert Build()
{
fixed (ecs_alert_desc_t* alertDesc = &Desc)
{
BindingContext.QueryContext* queryContext = Memory.Alloc<BindingContext.QueryContext>(1);
QueryContext* queryContext = Memory.Alloc<QueryContext>(1);
queryContext[0] = QueryBuilder.Context;

alertDesc->query = QueryBuilder.Desc;
alertDesc->query.binding_ctx = queryContext;
alertDesc->query.binding_ctx_free = BindingContext.QueryContextFreePointer;
alertDesc->query.binding_ctx_free = Pointers.QueryContextFree;

Entity entity = new Entity(World, ecs_alert_init(World, alertDesc));

Expand Down Expand Up @@ -258,7 +259,7 @@ public ref AlertBuilder Member<T>(string member, string var = "")

ulong id = Type<T>.Id(World);
ulong memberId = ecs_lookup_path_w_sep(World, id, nativeMember,
BindingContext.DefaultSeparator, BindingContext.DefaultSeparator, Utils.False);
Pointers.DefaultSeparator, Pointers.DefaultSeparator, Utils.False);

AlertVar(var);

Expand Down
Loading

0 comments on commit 523e471

Please sign in to comment.