mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-17 01:11:45 +00:00
[ecs] Add a "system" stuct for parameter passing
The system struct bundles the registry and component base together, making it easier to reuse systems in multiple registries, or really, easier to separate one set of ECS system components from those of other systems.
This commit is contained in:
parent
ead5e89165
commit
fdc0dba58b
1 changed files with 10 additions and 0 deletions
|
@ -72,6 +72,16 @@ typedef struct ecs_registry_s {
|
|||
PR_RESMAP (hierarchy_t) hierarchies;//FIXME find a better way
|
||||
} ecs_registry_t;
|
||||
|
||||
/** Tie an ECS system to a registry.
|
||||
|
||||
Keeps the registry using the system and the system's component base
|
||||
together.
|
||||
*/
|
||||
typedef struct ecs_system_s {
|
||||
ecs_registry_t *reg;
|
||||
uint32_t base;
|
||||
} ecs_system_t;
|
||||
|
||||
ecs_registry_t *ECS_NewRegistry (void);
|
||||
void ECS_DelRegistry (ecs_registry_t *registry);
|
||||
uint32_t ECS_RegisterComponents (ecs_registry_t *registry,
|
||||
|
|
Loading…
Reference in a new issue