- #:use-module (srfi srfi-9 gnu))
-
-
-;;; Engine Properties
-
-(define* (get-property property-path #:key (engine (current-engine)))
- (let ((entities (get-entities-by-components (list (car property-path)) #:engine engine)))
- (cond ((null? entities)
- #f)
- (else
- (let loop ((property (get-component (car property-path) (car entities)))
- (path (cdr property-path)))
- (cond ((or (null? path) (not property))
- property)
- (else
- (loop (assoc-ref property (car path)) (cdr path)))))))))
-
-(define* (set-property! property-path value #:key (engine (current-engine)))
- (define (loop property path)
- (cond ((null? path)
- value)
- (else
- (assoc-set! (or property '()) (car path) (loop (assoc-ref property (car path)) (cdr path))))))
-
- (let ((entities (get-entities-by-components (list (car property-path)) #:engine engine)))
- (cond ((null? entities)
- (new-entity! `(,(car property-path) . ,(loop '() (cdr property-path)))))
- (else
- (set-entity-components! (get-key (car entities)) `(,(car property-path) . ,(loop (get-component (car property-path) (car entities)) (cdr property-path))))))))
-
-(export get-property
- set-property!)
+ #:use-module (srfi srfi-9 gnu)
+ #:use-module (system repl server)
+ #:use-module (system repl coop-server))