aboutsummaryrefslogtreecommitdiff
path: root/world.c
diff options
context:
space:
mode:
Diffstat (limited to 'world.c')
-rw-r--r--world.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/world.c b/world.c
new file mode 100644
index 0000000..b271c3d
--- /dev/null
+++ b/world.c
@@ -0,0 +1,21 @@
+#include "world.h"
+
+void init_world(World* world) {
+ world->entity_count = 0;
+}
+
+Entity new_entity(World* world) {
+ Entity e;
+
+ e = world->entity_count++;
+ world->bitmask[e] = 0;
+ return e;
+}
+
+void add_components(World* world, Entity e, CType bits) {
+ world->bitmask[e] |= bits;
+}
+
+void remove_components(World* world, Entity e, CType bits) {
+ world->bitmask[e] &= ~bits;
+}