From 7d4d948dfa92416c802229b1c444a44785ee2a0c Mon Sep 17 00:00:00 2001 From: nathansmithsmith Date: Tue, 12 Sep 2023 21:53:32 -0600 Subject: Guided missile worky worky --- src/world.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/world.h') diff --git a/src/world.h b/src/world.h index 9e36dc7..d714649 100644 --- a/src/world.h +++ b/src/world.h @@ -18,6 +18,9 @@ typedef struct World { EntityId * vacantIds; size_t vacantIdsCount; + Entity * entitiesToAdd; + size_t entitiesToAddCount; + // Used for making fingerprints for entities. EntityFingerprint currentFingerprint; } World; @@ -32,6 +35,10 @@ Entity * getEntityFromWorld(World world, EntityId id); EntityId addEntityToWorld(World * world, Entity entity); KfError removeEntityFromWorld(World * world, EntityId id); +// Entities can't be added to world during update loop so we schedule the mother fuckers. +KfError scheduleEntityToAdd(World * world, Entity entity); +KfError handleScheduledEntities(World * world); + void updateWorld(World * world, Game * game); void drawWorld(World * world, Game * game); -- cgit v1.2.3