;;;; asset.lisp (in-package #:wheelwork) (def:class asset () ((path "Path to asset") :required :ro :prefix :type (or pathname string)) (loadedp :prefix :type boolean :initform nil)) (defmethod cleanup :around ((asset asset)) (when (asset-loadedp asset) (call-next-method)) (setf (asset-loadedp asset) nil)) (defmethod ensure-loaded :around ((thing asset)) (unless (asset-loadedp thing) (call-next-method) (setf (asset-loadedp thing) t)) thing)