From: jsancho Date: Thu, 30 Jun 2011 19:30:01 +0000 (+0000) Subject: (no commit message) X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=adc4651eb62039c950d760c5bfc1eaee774ce4a5;p=gacela.git --- diff --git a/src/gacela_mobs.scm b/src/gacela_mobs.scm index 5ae3296..69f702f 100755 --- a/src/gacela_mobs.scm +++ b/src/gacela_mobs.scm @@ -128,11 +128,29 @@ renders) ((set-renders) (if (not (null? params)) (set! renders (car params)))) + ((actions) + (for-each + (lambda (action) + (set! attr ((cdr action) attr))) + actions)) ((render) - (for-each (lambda (render) ((cdr render) attr)) renders)))))) + (for-each + (lambda (render) + ((cdr render) attr)) + renders)))))) (cond ((not (null? ',look)) (mob 'set-renders (list (cons 'default-look (lambda-look ,attr ,@look)))))) mob)) + +(define (get-mob-attr mob var) + (let ((value (assoc-ref (mob 'get-attr) var))) + (if value (car value) #f))) + +(define (set-mob-attr! mob var value) + (mob 'set-attr (assoc-set! (mob 'get-attr) var (list value)))) + +(define (add-mob-action mob name action) + )