diff options
Diffstat (limited to 'src/world.h')
-rw-r--r-- | src/world.h | 7 |
1 files changed, 7 insertions, 0 deletions
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); |