- (elist (lset-difference eq? (assoc-ref clist type) (list entity))))
- (unregister-components entity (cdr components)
- (cond ((null? elist)
- (assoc-remove! clist type))
- (else
- (assoc-set! clist type elist))))))))
+ (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)))
+
+(define (entity-ref key entity-set)
+ (hash-get-handle (car entity-set) key))