You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
using System;
|
|
|
|
using static flecs_hub.flecs;
|
|
|
|
using static flecs_hub.flecs.Runtime;
|
|
|
|
|
|
|
|
namespace gaemstone.ECS;
|
|
|
|
|
|
|
|
public unsafe partial class Universe
|
|
|
|
{
|
|
|
|
public ecs_world_t* Handle { get; }
|
|
|
|
|
|
|
|
public Universe(params string[] args)
|
|
|
|
{
|
|
|
|
var argv = CStrings.CStringArray(args);
|
|
|
|
Handle = ecs_init_w_args(args.Length, argv);
|
|
|
|
CStrings.FreeCStrings(argv, args.Length);
|
|
|
|
|
|
|
|
RegisterBuiltInLookups();
|
|
|
|
this.RegisterEntity<Game>();
|
|
|
|
this.RegisterComponent<Module>();
|
|
|
|
}
|
|
|
|
|
|
|
|
public bool Progress(TimeSpan delta)
|
|
|
|
=> ecs_progress(this, (float)delta.TotalSeconds);
|
|
|
|
|
|
|
|
public static implicit operator ecs_world_t*(Universe w) => w.Handle;
|
|
|
|
}
|