aboutsummaryrefslogtreecommitdiff
path: root/src/world.h
diff options
context:
space:
mode:
authornathansmithsmith <nathansmith7@mailfence.com>2023-09-12 21:53:32 -0600
committernathansmithsmith <nathansmith7@mailfence.com>2023-09-12 21:53:32 -0600
commit7d4d948dfa92416c802229b1c444a44785ee2a0c (patch)
tree129fcf7141640ec8b3c7647de174755d04858ce2 /src/world.h
parentc759231e1e8570ffe5fdda2f1eb5d011b1c6a29f (diff)
Guided missile worky worky
Diffstat (limited to 'src/world.h')
-rw-r--r--src/world.h7
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);