aboutsummaryrefslogtreecommitdiff
path: root/world.scm
diff options
context:
space:
mode:
authorGene Pasquet <dev@etenil.net>2026-04-12 15:57:45 +0100
committerGene Pasquet <dev@etenil.net>2026-04-12 15:57:45 +0100
commitc1c868d9b6ee61002c7ccb33fbc6a15c5b090e6a (patch)
treeb818607a0e2ab52113e3fcead77a096b9adfdbfb /world.scm
parente1da1b0c2b2df9880e7f0a76b6ecc7aefecaf229 (diff)
Enrich entities pipelining to provide scene context to processors
Diffstat (limited to 'world.scm')
-rw-r--r--world.scm8
1 files changed, 5 insertions, 3 deletions
diff --git a/world.scm b/world.scm
index d09b9c9..0726eea 100644
--- a/world.scm
+++ b/world.scm
@@ -49,9 +49,11 @@
(define (scene-map-entities scene . procs)
"Apply each proc in sequence to the scene's entities; returns a new scene."
(update-scene scene
- entities: (fold (lambda (proc es) (map proc es))
- (scene-entities scene)
- procs)))
+ entities: (fold
+ (lambda (proc es)
+ (map (cut proc scene <>) es))
+ (scene-entities scene)
+ procs)))
(define (scene-filter-entities scene pred)
"Keep only entities satisfying pred; returns a new scene."