Move system initialization in systems.c, properly delete all entities when unloading map
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user