Skip to content

Commit 32630f8

Browse files
authored
Reformat sub_systems function for improved readability
1 parent c5e3ebd commit 32630f8

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

‎addons/gecs/docs/CORE_CONCEPTS.md‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,18 @@ extends System
333333
func sub_systems():
334334
return [
335335
# [query, callable] - all use same unified process signature
336-
[ECS.world.query.with_all([C_Health, C_Damage]), damage_entities],
337-
[ECS.world.query.with_all([C_Health]).with_none([C_Dead]).iterate([C_Health]), regenerate_health]
336+
[
337+
q
338+
.with_all([C_Health, C_Damage]),
339+
damage_entities
340+
],
341+
[
342+
q
343+
.with_all([C_Health])
344+
.with_none([C_Dead])
345+
.iterate([C_Health]),
346+
regenerate_health
347+
]
338348
]
339349
340350
func damage_entities(entities: Array[Entity], components: Array, delta: float):
@@ -406,6 +416,7 @@ ECS.world.query
406416
.with_relationship([r_attacking_player]) # Must have these relationships
407417
.without_relationship([r_fleeing]) # Must not have these relationships
408418
.with_reverse_relationship([r_parent_of]) # Must be target of these relationships
419+
.iterate([C_Health]) # Fetch these components and add to components array for quick iteration
409420
```
410421

411422
### Query Methods

0 commit comments

Comments
 (0)