parent
0e25265366
commit
fc2cfdc8b4
5 changed files with 49 additions and 37 deletions
@ -0,0 +1,20 @@ |
|||||||
|
using System.Runtime.InteropServices; |
||||||
|
using gaemstone.ECS; |
||||||
|
using static flecs_hub.flecs; |
||||||
|
|
||||||
|
namespace gaemstone.Systems; |
||||||
|
|
||||||
|
[Module(Name = "flecs.monitor")] |
||||||
|
public unsafe class Monitor |
||||||
|
: IModuleInitializer |
||||||
|
{ |
||||||
|
public void Initialize(EntityRef entity) |
||||||
|
{ |
||||||
|
ecs_import_c(entity.Universe, new() { Data = new() { |
||||||
|
Pointer = &MonitorImport } }, "FlecsMonitor"); |
||||||
|
} |
||||||
|
|
||||||
|
[UnmanagedCallersOnly] |
||||||
|
private static void MonitorImport(ecs_world_t* world) |
||||||
|
=> FlecsMonitorImport(world); |
||||||
|
} |
@ -0,0 +1,22 @@ |
|||||||
|
using System.Runtime.InteropServices; |
||||||
|
using gaemstone.ECS; |
||||||
|
using static flecs_hub.flecs; |
||||||
|
|
||||||
|
namespace gaemstone.Systems; |
||||||
|
|
||||||
|
[Module(Name = "flecs.rest")] |
||||||
|
public unsafe class Rest |
||||||
|
: IModuleInitializer |
||||||
|
{ |
||||||
|
public void Initialize(EntityRef entity) |
||||||
|
{ |
||||||
|
ecs_import_c(entity.Universe, new() { Data = new() { |
||||||
|
Pointer = &RestImport } }, "FlecsRest"); |
||||||
|
entity.NewChild("Rest").Build() |
||||||
|
.CreateLookup<EcsRest>().Set(new EcsRest { port = 27750 }); |
||||||
|
} |
||||||
|
|
||||||
|
[UnmanagedCallersOnly] |
||||||
|
static void RestImport(ecs_world_t* world) |
||||||
|
=> FlecsRestImport(world); |
||||||
|
} |
Loading…
Reference in new issue