1
0
Fork 0

Change to fit new api

This commit is contained in:
Booklordofthedings 2024-11-19 14:14:51 +01:00
parent e63aab283b
commit a3e655583b
2 changed files with 4 additions and 4 deletions

View file

@ -6,8 +6,8 @@ struct MovingBall : IArchetypeable
{ {
public void Instantiate(ECS ecs, Entity e) public void Instantiate(ECS ecs, Entity e)
{ {
ecs.Components.AddComponentToEntity(e, ecs.Components.GetId(typeof(Position).GetFullName(.. scope .())), &Position()); ecs.Components.AddToEntity(e, ecs.Components.GetId(typeof(Position).GetFullName(.. scope .())), &Position());
ecs.Components.AddComponentToEntity(e, ecs.Components.GetId(typeof(Velocity).GetFullName(.. scope .())), &Velocity()); ecs.Components.AddToEntity(e, ecs.Components.GetId(typeof(Velocity).GetFullName(.. scope .())), &Velocity());
ecs.Components.AddComponentToEntity(e, ecs.Components.GetId(typeof(Sprite).GetFullName(.. scope .())), &Sprite()); ecs.Components.AddToEntity(e, ecs.Components.GetId(typeof(Sprite).GetFullName(.. scope .())), &Sprite());
} }
} }

View file

@ -25,7 +25,7 @@ class Program
uint64 entityCounter = 0; uint64 entityCounter = 0;
for(int32 i < 50000) for(int32 i < 50)
{ {
entityCounter++; entityCounter++;
ecs.Entities.Create(MovingBall()); ecs.Entities.Create(MovingBall());