-(define (register-components entity components clist)
- (cond ((null? components) clist)
- (else
- (let* ((type (car components))
- (elist (hash-ref clist type)))
- (hash-set! clist type
- (cond (elist
- (lset-adjoin eq? elist entity))
- (else
- (list entity))))
- (register-components entity (cdr components) clist)))))
-
-(define (unregister-components entity components clist)
- (cond ((null? components) clist)
- (else
- (let* ((type (car components))
- (elist (lset-difference eq? (hash-ref clist type) (list entity))))
- (cond ((null? elist)
- (hash-remove! clist type))
- (else
- (hash-set! clist type elist)))
- (unregister-components entity (cdr components) clist)))))
-
-(define (component-names components)
- (map (lambda (c) (car c)) components))
-
-(define (entity-component-names key entity-set)
- (component-names
- (hash-ref (car entity-set) key)))
-