Move flecs built-ins to own namespace

wip/source-generators
copygirl 2 years ago
parent 94bf1b4604
commit c21726dd01
  1. 1
      src/Immersion/ObserverTest.cs
  2. 5
      src/Immersion/Program.cs
  3. 1
      src/gaemstone.Client/Systems/Input.cs
  4. 1
      src/gaemstone.Client/Systems/Renderer.cs
  5. 1
      src/gaemstone.Client/Systems/Windowing.cs
  6. 2
      src/gaemstone/ECS/Entity.cs
  7. 2
      src/gaemstone/ECS/EntityBase.cs
  8. 4
      src/gaemstone/ECS/System.cs
  9. 2
      src/gaemstone/ECS/Universe+Modules.cs
  10. 6
      src/gaemstone/ECS/Universe.cs
  11. 6
      src/gaemstone/Flecs/Core.cs
  12. 5
      src/gaemstone/Flecs/FlecsException.cs
  13. 4
      src/gaemstone/Flecs/ObserverEvent.cs
  14. 4
      src/gaemstone/Flecs/SystemPhase.cs
  15. 2
      src/gaemstone/Flecs/Systems/Monitor.cs
  16. 2
      src/gaemstone/Flecs/Systems/Rest.cs

@ -1,5 +1,6 @@
using System;
using gaemstone.ECS;
using gaemstone.Flecs;
using static gaemstone.Bloxel.Components.CoreComponents;
using static gaemstone.Client.Components.RenderingComponents;

@ -4,6 +4,7 @@ using System.Threading;
using gaemstone.Bloxel;
using gaemstone.Client;
using gaemstone.ECS;
using gaemstone.Flecs;
using gaemstone.Utility;
using Silk.NET.Maths;
using Silk.NET.OpenGL;
@ -22,8 +23,8 @@ Resources.ResourceAssembly = typeof(Program).Assembly;
var universe = new Universe();
var game = universe.LookupOrThrow<Game>();
universe.Modules.Register<gaemstone.Systems.Rest>();
universe.Modules.Register<gaemstone.Systems.Monitor>();
universe.Modules.Register<gaemstone.Flecs.Systems.Rest>();
universe.Modules.Register<gaemstone.Flecs.Systems.Monitor>();
var window = Window.Create(WindowOptions.Default with {
Title = "gæmstone",

@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using gaemstone.ECS;
using gaemstone.Flecs;
using Silk.NET.Input;
using Silk.NET.Maths;
using static gaemstone.Client.Systems.Windowing;

@ -2,6 +2,7 @@ using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using gaemstone.ECS;
using gaemstone.Flecs;
using Silk.NET.Maths;
using Silk.NET.OpenGL;
using Silk.NET.Windowing;

@ -1,4 +1,5 @@
using gaemstone.ECS;
using gaemstone.Flecs;
using Silk.NET.Maths;
using Silk.NET.OpenGL;
using Silk.NET.Windowing;

@ -21,7 +21,7 @@ public readonly struct Entity
public bool IsNone => Value.Data == 0;
public Entity ThrowIfNone() => !IsNone ? this
: throw new FlecsException(this + " is none");
: throw new InvalidOperationException(this + " is none");
public Entity(ecs_entity_t value) => Value = value;

@ -1,4 +1,4 @@
using static gaemstone.ECS.BuiltIn;
using static gaemstone.Flecs.Core;
namespace gaemstone.ECS;

@ -1,9 +1,11 @@
using System;
using System.Reflection;
using System.Runtime.InteropServices;
using gaemstone.Flecs;
using gaemstone.Utility;
using gaemstone.Utility.IL;
using static flecs_hub.flecs;
using static gaemstone.Flecs.Core;
namespace gaemstone.ECS;
@ -26,7 +28,7 @@ public static class SystemExtensions
var desc = new ecs_system_desc_t {
query = query.ToFlecs(),
entity = universe.New(name)
.Add<BuiltIn.DependsOn>(phase)
.Add<DependsOn>(phase)
.Add(phase)
.Build(),
binding_ctx = (void*)CallbackContextHelper.Create((universe, callback)),

@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using gaemstone.Utility;
using static gaemstone.ECS.BuiltIn;
using static gaemstone.Flecs.Core;
namespace gaemstone.ECS;

@ -18,9 +18,9 @@ public unsafe partial class Universe
CStrings.FreeCStrings(argv, args.Length);
Modules = new(this);
Modules.Register(typeof(BuiltIn));
Modules.Register(typeof(ObserverEvent));
Modules.Register(typeof(SystemPhase));
Modules.Register(typeof(Flecs.Core));
Modules.Register(typeof(Flecs.ObserverEvent));
Modules.Register(typeof(Flecs.SystemPhase));
New("Game", "Game").Build().CreateLookup<Game>();
}

@ -1,7 +1,9 @@
namespace gaemstone.ECS;
using gaemstone.ECS;
namespace gaemstone.Flecs;
[Module(Name = "flecs.core")]
public static class BuiltIn
public static class Core
{
// Entity Tags
[Tag] public struct Module { }

@ -3,7 +3,7 @@ using System.Diagnostics;
using System.Runtime.InteropServices;
using static flecs_hub.flecs;
namespace gaemstone.ECS;
namespace gaemstone.Flecs;
public class FlecsException
: Exception
@ -31,5 +31,6 @@ public class FlecsAbortException
}
[UnmanagedCallersOnly]
private static void Abort() => throw new FlecsAbortException();
private static void Abort()
=> throw new FlecsAbortException();
}

@ -1,6 +1,6 @@
using System.Reflection;
using gaemstone.ECS;
namespace gaemstone.ECS;
namespace gaemstone.Flecs;
[Module(Name = "flecs.core")]
public static class ObserverEvent

@ -1,4 +1,6 @@
namespace gaemstone.ECS;
using gaemstone.ECS;
namespace gaemstone.Flecs;
[Module(Name = "flecs.pipeline")]
public static class SystemPhase

@ -2,7 +2,7 @@ using System.Runtime.InteropServices;
using gaemstone.ECS;
using static flecs_hub.flecs;
namespace gaemstone.Systems;
namespace gaemstone.Flecs.Systems;
[Module(Name = "flecs.monitor")]
public unsafe class Monitor

@ -2,7 +2,7 @@ using System.Runtime.InteropServices;
using gaemstone.ECS;
using static flecs_hub.flecs;
namespace gaemstone.Systems;
namespace gaemstone.Flecs.Systems;
[Module(Name = "flecs.rest")]
public unsafe class Rest
Loading…
Cancel
Save