(define-component a x y)
+(define-system s1 ()
+ (entities-changes
+ (list
+ (new-entity (make-a 1 2))
+ (new-entity (make-a 10 20)))))
+
+(define-system s2 ((with-a (a)))
+ (for-each
+ (lambda (e)
+ (format #t "Key: ~a Component: ~a~%" (get-key e) (get-component 'a e)))
+ with-a))
+
(define (making-systems)
- (let ((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)
-
- (((make-system '(a) (lambda (e) (display e) (newline) '())) entities components))))
+ (let ((entities (make-entity-set)))
+ (set! entities (modify-entities entities (get-entities-changes (s1 entities))))
+ (format #t "Two new entities with a:~%~a~%~%" (entity-list entities))
+
+ (s2 entities)))
(export making-systems)