MoonTools.ECS/src/Spawner.cs

14 lines
537 B
C#
Raw Normal View History

2023-02-09 18:50:25 +00:00
namespace MoonTools.ECS
{
2023-02-10 19:59:40 +00:00
public abstract class Spawner : EntityComponentReader
2023-02-09 18:50:25 +00:00
{
2023-02-10 19:59:40 +00:00
public Spawner(World world) : base(world)
2023-02-09 18:50:25 +00:00
{
}
protected Entity CreateEntity() => World.CreateEntity();
protected void Set<TComponent>(in Entity entity, in TComponent component) where TComponent : unmanaged => World.Set<TComponent>(entity, component);
protected void Relate<TRelationKind>(in Entity entityA, in Entity entityB, TRelationKind relationData) where TRelationKind : unmanaged => World.Relate(entityA, entityB, relationData);
}
}