- `(let ((attr ,(make-object-attributes attr) bhv ,(make-object-behaviour bhv)))
- (defun ,name (option) ,@look)
- ))
+ `(progn
+ (let ((attr ,(cond (attr (cons 'list (make-object-attributes attr)))))
+ (bhv ,(cond (bhv (cons 'list (make-object-behaviour bhv))))))
+ (defun ,name (option &rest param)
+ (case option
+ (:action (dolist (b bhv t) (setq attr (funcall (get-behaviour-fun-name b) attr))))
+ (:get-attr attr)
+ (:get-bhv bhv)
+ (:set-bhv (setq bhv (car param)))
+ (:render (glPushMatrix)
+ ,@(mapcar (lambda (x) (if (stringp x) `(draw-image ,x) x)) look)
+ (glPopMatrix)))))
+ (add-object ',name)
+ ',name))