|
|
@ -1,4 +1,5 @@ |
|
|
|
using System; |
|
|
|
using System; |
|
|
|
|
|
|
|
using System.Linq; |
|
|
|
using static flecs_hub.flecs; |
|
|
|
using static flecs_hub.flecs; |
|
|
|
|
|
|
|
|
|
|
|
namespace gaemstone.ECS; |
|
|
|
namespace gaemstone.ECS; |
|
|
@ -15,17 +16,20 @@ public unsafe partial class Universe |
|
|
|
|
|
|
|
|
|
|
|
public Universe(params string[] args) |
|
|
|
public Universe(params string[] args) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Handle = ecs_init_w_args(args.Length, null); |
|
|
|
Handle = ecs_init_w_args(args.Length, null); |
|
|
|
|
|
|
|
|
|
|
|
Modules = new(this); |
|
|
|
Modules = new(this); |
|
|
|
Modules.Register(typeof(Flecs.Core)); |
|
|
|
|
|
|
|
Modules.Register(typeof(Flecs.Pipeline)); |
|
|
|
// Register built-in (static) modules, which |
|
|
|
Modules.Register(typeof(Flecs.ObserverEvent)); |
|
|
|
// are defined in the "gaemstone.Flecs" namespace. |
|
|
|
Modules.Register(typeof(Flecs.SystemPhase)); |
|
|
|
Modules.RegisterAll(GetType().Assembly.GetTypes() |
|
|
|
|
|
|
|
.Where(t => t.IsAbstract && t.IsSealed)); |
|
|
|
|
|
|
|
|
|
|
|
ChildOf = LookupOrThrow<Flecs.Core.ChildOf>(); |
|
|
|
ChildOf = LookupOrThrow<Flecs.Core.ChildOf>(); |
|
|
|
|
|
|
|
|
|
|
|
New("Game").Symbol("Game").Build().CreateLookup<Game>().Add<Game>(); |
|
|
|
// Create "Game" singleton entity, which |
|
|
|
|
|
|
|
// stores global state, configuration, ... |
|
|
|
|
|
|
|
New("Game").Symbol("Game").Build() |
|
|
|
|
|
|
|
.CreateLookup<Game>().Add<Game>(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public EntityBuilder New(EntityPath? path = null) |
|
|
|
public EntityBuilder New(EntityPath? path = null) |
|
|
|