Line |
Branch |
Exec |
Source |
1 |
|
|
/* |
2 |
|
|
* Filename: /workspaces/our_rpg/lib/ECS/source/world.c |
3 |
|
|
* Path: /workspaces/our_rpg/lib/ECS/source |
4 |
|
|
* Created Date: Wednesday, December 21st 2022, 8:20:21 am |
5 |
|
|
* Author: osvegn |
6 |
|
|
* |
7 |
|
|
* Copyright (c) 2023 our_rpg |
8 |
|
|
*/ |
9 |
|
|
|
10 |
|
|
#include "world.h" |
11 |
|
|
#include <stddef.h> |
12 |
|
|
|
13 |
|
✗ |
int world_run_systems(world_t *world) |
14 |
|
|
{ |
15 |
|
✗ |
vector_t *ptr = &world->system_list; |
16 |
|
|
system_t *system = NULL; |
17 |
|
✗ |
unsigned int size = ptr->size(ptr); |
18 |
|
|
int rvalue = 0; |
19 |
|
|
|
20 |
|
✗ |
for (unsigned int i = 0; i < size; i++) { |
21 |
|
✗ |
system = ptr->at(ptr, i); |
22 |
|
✗ |
if (system && system->run) |
23 |
|
✗ |
rvalue = system->run((void *)world); |
24 |
|
|
else |
25 |
|
|
return -1; |
26 |
|
✗ |
if (rvalue) |
27 |
|
✗ |
return rvalue; |
28 |
|
|
} |
29 |
|
|
return 0; |
30 |
|
|
} |
31 |
|
|
|