aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/assets/asset.lisp
blob: 5f847da3315387592c8fa333a5850fe55c0bf5e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
;;;; asset.lisp

(in-package #:wheelwork)

(defclass/std asset ()
  ((path :with :ri :std (error "An asset requires a path"))
   (loadedp :with :a)))

(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)