From 9b261e3a07d92edf68979b46f756413a0ac9247a Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Wed, 4 Sep 2013 18:30:35 +0200 Subject: [PATCH] More verbose mode for working with entities and components; assoc lists no more needed * src/system.scm: entities/components functions now return a function for changing the entity/component structure * src/test.scm: functions testing adapted to new scheme --- src/system.scm | 2 +- src/test.scm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/system.scm b/src/system.scm index 9ad9ef0..502ccd6 100644 --- a/src/system.scm +++ b/src/system.scm @@ -184,7 +184,7 @@ (lambda* (#:optional (entities2 #f) (components2 #f)) (let ((e (if (and entities2 components2) entities2 entities)) (c (if (and entities2 components2) components2 components))) - (set-entities res e c)))))) + (modify-entities res e c)))))) (define (join-systems . systems) diff --git a/src/test.scm b/src/test.scm index fc710f2..353987b 100644 --- a/src/test.scm +++ b/src/test.scm @@ -77,7 +77,7 @@ (define (test2) (let ((entities '()) (components '())) - (receive (e c) (((make-system '() (lambda (e) `((#f . (,(make-a 1 2))) (#f . (,(make-a 10 20)))))) entities components)) + (receive (e c) (((make-system '() (lambda (e) (list (new-entity (make-a 1 2)) (new-entity (make-a 10 20))))) entities components)) (set! entities e) (set! components c)) (format #t "Two new entities with a:~%~a~%~a~%~%" entities components) -- 2.39.2