Minor cleanup, remove sealed modifier

wip/bindgen
copygirl 1 year ago
parent 552022597f
commit 1fa1fa4a3c
  1. 6
      src/gaemstone.ECS/Filter.cs
  2. 2
      src/gaemstone.ECS/Query.cs
  3. 2
      src/gaemstone.ECS/Rule.cs
  4. 7
      src/gaemstone.Utility/Allocators.cs
  5. 1
      src/gaemstone.Utility/CallbackContextHelper.cs

@ -6,7 +6,7 @@ using static flecs_hub.flecs;
namespace gaemstone.ECS;
public unsafe sealed class Filter
public unsafe class Filter
: IDisposable
{
public World World { get; }
@ -21,13 +21,13 @@ public unsafe sealed class Filter
}
public void Dispose()
=> ecs_filter_fini(Handle);
=> ecs_filter_fini(this);
public Iterator Iter()
=> new(World, IteratorType.Filter, ecs_filter_iter(World, this));
public override string ToString()
=> ecs_filter_str(World, Handle).FlecsToStringAndFree()!;
=> ecs_filter_str(World, this).FlecsToStringAndFree()!;
public static implicit operator ecs_filter_t*(Filter q) => q.Handle;
}

@ -4,7 +4,7 @@ using static flecs_hub.flecs;
namespace gaemstone.ECS;
public unsafe sealed class Query
public unsafe class Query
: IDisposable
{
public World World { get; }

@ -4,7 +4,7 @@ using static flecs_hub.flecs;
namespace gaemstone.ECS;
public unsafe sealed class Rule
public unsafe class Rule
: IDisposable
{
public World World { get; }

@ -68,6 +68,7 @@ public static class TempAllocator
public ResetOnDispose(ArenaAllocator allocator, int start)
{ _allocator = allocator; _start = start; }
// TODO: Print warning in finalizer if Dispose wasn't called manually.
// IAllocator implementation
@ -90,7 +91,7 @@ public class GlobalHeapAllocator
=> Marshal.FreeHGlobal(pointer);
}
public sealed class ArenaAllocator
public class ArenaAllocator
: IAllocator
, IDisposable
{
@ -133,7 +134,7 @@ public sealed class ArenaAllocator
}
}
public sealed class RingAllocator
public class RingAllocator
: IAllocator
, IDisposable
{
@ -166,5 +167,5 @@ public sealed class RingAllocator
}
public void Free(nint pointer)
{ /* IGNORE */ }
{ /* Do nothing. */ }
}

@ -27,5 +27,4 @@ public static class CallbackContextHelper
lock (_contexts)
_contexts.Remove(id);
}
}

Loading…
Cancel
Save