aboutsummaryrefslogtreecommitdiff
path: root/src/world.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/world.h')
-rw-r--r--src/world.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/world.h b/src/world.h
index 379b920..b075301 100644
--- a/src/world.h
+++ b/src/world.h
@@ -4,4 +4,35 @@
#ifndef WORLD_H
#define WORLD_H
+#define FINGERPRINT_START_RANGE_MIN 0xf
+#define FINGERPRINT_START_RANGE_MAX 0xff
+
+typedef struct World {
+ Entity * entities;
+ size_t entitiesCount;
+
+ // For getting entity id;
+ EntityId * lookUp;
+ size_t lookUpSize;
+
+ EntityId * vacantIds;
+ size_t vacantIdsCount;
+
+ // Used for making fingerprints for entities.
+ EntityFingerprint currentFingerprint;
+} World;
+
+void initWorld(World * world);
+void freeWorld(World * world);
+
+#define ENTITY_ID_NONE -1
+
+// ENTITY_ID_NONE on error.
+Entity * getEntityFromWorld(World world, EntityId id);
+EntityId addEntityToWorld(World * world, Entity entity);
+KfError removeEntityFromWorld(World * world, EntityId id);
+
+void updateWorld(World * world, Game * game);
+void drawWorld(World * world, Game * game);
+
#endif