From: Javier Sancho Date: Wed, 4 Sep 2013 16:30:35 +0000 (+0200) Subject: More verbose mode for working with entities and components; assoc X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=9b261e3a07d92edf68979b46f756413a0ac9247a;p=gacela.git 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 --- 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)