Pass requested entity components as arguments to 'entity systems
This commit is contained in:
parent
d379cd28d7
commit
b37f78330c
2 changed files with 57 additions and 58 deletions
|
|
@ -271,7 +271,17 @@
|
|||
(let ((entities (map get-entity (set->list (apply query-by-components (system-criteria system))))))
|
||||
(cond
|
||||
((eqv? (system-mode system) 'batch) ((system-process system) entities))
|
||||
((eqv? (system-mode system) 'entity) (for-each (lambda (e) ((system-process system) e)) entities))))))
|
||||
((eqv? (system-mode system) 'entity)
|
||||
(for-each (lambda (e)
|
||||
(apply (system-process system)
|
||||
(cons e
|
||||
(map (lambda (component)
|
||||
(find (lambda (c)
|
||||
(eqv? (rtd-name (record-rtd c))
|
||||
component))
|
||||
e))
|
||||
(system-criteria system)))))
|
||||
entities))))))
|
||||
|
||||
(define (execute-systems)
|
||||
(for-each
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue