summaryrefslogtreecommitdiff
path: root/src/game.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.c')
-rw-r--r--src/game.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/game.c b/src/game.c
index 615e06e..665363d 100644
--- a/src/game.c
+++ b/src/game.c
@@ -88,3 +88,12 @@ game_create_entity(Game *this)
this->uuid += 1;
return e;
}
+
+int
+game_entity_count(Game *this, unsigned int type)
+{
+ int count = 0;
+ for (int i = 0; i < MAX_ENTITIES; i++)
+ count += (this->entities[i].type == type);
+ return count;
+}