Skip to content

Commit

Permalink
Adding function to get default ecs system template object.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chukobyte committed Feb 9, 2024
1 parent 259979e commit 04d7f5e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
9 changes: 8 additions & 1 deletion seika/ecs/ec_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,17 @@ SkaECSSystem* ska_ecs_system_create_from_template(SkaECSSystemTemplate* systemTe
newSystem->update_func = systemTemplate->update_func;
newSystem->fixed_update_func = systemTemplate->fixed_update_func;
newSystem->network_callback_func = systemTemplate->network_callback_func;
newSystem->on_entity_start_func = systemTemplate->on_entity_start_func;
return newSystem;
}

SkaECSSystemTemplate ska_ecs_system_create_default_template(const char* systemName) {
return (SkaECSSystemTemplate){
.name = systemName, .on_ec_system_register = NULL, .on_ec_system_destroy = NULL, .on_entity_registered_func = NULL, .on_entity_start_func = NULL, .on_entity_end_func = NULL,
.on_entity_unregistered_func = NULL, .on_entity_entered_scene_func = NULL, .render_func = NULL, .pre_update_all_func = NULL, .post_update_all_func = NULL,
.update_func = NULL, .fixed_update_func = NULL, .network_callback_func = NULL
};
}

static SkaECSSystem* update_system_with_type_signature_string(SkaECSSystem* system, const char* signatures) {
// Take signature string, create flags, and add to system's component signature
static char typeNameBuffer[256];
Expand Down
1 change: 1 addition & 0 deletions seika/ecs/ec_system.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ SkaECSSystem* ska_ecs_system_create(const char* systemName);
SkaECSSystem* ska_ecs_system_create_from_template(SkaECSSystemTemplate* systemTemplate);
SkaECSSystem* ska_ecs_system_create_with_signature_string(const char* systemName, const char* signatures);
SkaECSSystem* ska_ecs_system_create_from_template_with_signature_string(SkaECSSystemTemplate* systemTemplate, const char* signatures);
SkaECSSystemTemplate ska_ecs_system_create_default_template(const char* systemName);
void ska_ecs_system_destroy(SkaECSSystem* entitySystem);
void ska_ecs_system_register(SkaECSSystem* system);
void ska_ecs_system_update_entity_signature_with_systems(SkaEntity entity);
Expand Down
2 changes: 1 addition & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "seika",
"version": "0.0.31",
"version": "0.0.32",
"dependencies": [
{
"name": "sdl2",
Expand Down

0 comments on commit 04d7f5e

Please sign in to comment.