Add entity_factory

This commit is contained in:
2024-01-04 16:40:39 +01:00
parent c83f0fb666
commit cc6b1c1a35
7 changed files with 81 additions and 48 deletions

View File

@@ -152,6 +152,21 @@ typedef struct EntityArms {
* Gameplay components
*********************************************************/
typedef struct WeaponMelee {
} WeaponMelee;
typedef struct WeaponRanged {
} WeaponRanged;
typedef struct WeaponShield {
} WeaponShield;
typedef struct AttachedWeapons {
ecs_entity_t primary;
ecs_entity_t secondary;
} AttachedWeapons;
extern ECS_COMPONENT_DECLARE(UnitAction);
extern ECS_COMPONENT_DECLARE(UnitAI);
@@ -185,11 +200,4 @@ 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