Move system initialization in systems.c, properly delete all entities when unloading map

This commit is contained in:
2023-12-29 17:18:06 +01:00
parent 5190c86316
commit cc66f15131
8 changed files with 84 additions and 82 deletions

View File

@@ -6,6 +6,9 @@
#include "game_tileset.h"
// Needed, so we can clean up all game created entities
extern ECS_TAG_DECLARE(GameEntity);
typedef enum ResourceType {
RES_IRON,
RES_WOOD,
@@ -190,5 +193,11 @@ extern ECS_TAG_DECLARE(Attackable);
void initComponentIDs(ecs_world_t *ecs);
static ecs_entity_t entityCreate(ecs_world_t *ecs) {
ecs_entity_t entity = ecs_new_id(ecs);
ecs_add_id(ecs, entity, GameEntity);
return entity;
}
#endif //PIXELDEFENSE_COMPONENTS_H