using System.Linq; using gaemstone.ECS; namespace gaemstone; public class Universe : World { public ModuleManager Modules { get; } public Universe(params string[] args) : base(args) { Modules = new(this); // Bootstrap some stuff, so we can register flecs properly. New("/gaemstone/Doc/DisplayType") .Add(LookupByPathOrThrow("/flecs/core/Exclusive")) .Build().CreateLookup(); New("/gaemstone/Doc/Relation").Build().CreateLookup(); LookupByPathOrThrow("/flecs/core/Module" ).CreateLookup(); LookupByPathOrThrow("/flecs/core/Component").CreateLookup(); LookupByPathOrThrow("/flecs/core/Tag" ).CreateLookup(); // Register built-in (static) modules, which // are defined in the "gaemstone.Flecs" namespace. Modules.RegisterAll(GetType().Assembly.GetTypes() .Where(t => t.IsAbstract && t.IsSealed)); Modules.Register(); // Create "Game" entity to store global state. New("/Game").Symbol("Game").Build() .CreateLookup().Add(); } }