1
0
Fork 0
Theater-ECS-Example/src/Archetypes/MovingBall.bf

17 lines
No EOL
525 B
Beef

namespace Theater_ECS_Example.Archetypes;
using Theater_ECS_Example.Components;
using Theater_ECS;
struct MovingBall : IArchetypeable
{
public void Instantiate(ECS ecs, Entity e)
{
ecs.Components.AddToEntity(e, ecs.Components.GetId(typeof(Position).GetFullName(.. scope .())), &Position());
ecs.Components.AddToEntity(e, ecs.Components.GetId(typeof(Velocity).GetFullName(.. scope .())), &Velocity());
ecs.Components.AddToEntity(e, ecs.Components.GetId(typeof(Sprite).GetFullName(.. scope .())), &Sprite(1));
}
}