diff options
Diffstat (limited to 'model.lisp')
-rw-r--r-- | model.lisp | 18 |
1 files changed, 15 insertions, 3 deletions
@@ -51,7 +51,7 @@ :initarg :fulfillment :initform nil :accessor fulfillment - :documentation "Ideally a date and time when the feat was fulfilled. + :documentation "Ideally a universal time when the feat was fulfilled. If nil, implies the feat is yet to be fulfilled.") (description :initarg :description @@ -77,7 +77,19 @@ Example: (:metaclass db:persistent-class) (:documentation "Feat with Steam specific slots.")) +(defmethod print-object ((object steam-achievement) stream) + (print-unreadable-object (object stream :type t :identity t) + (princ (name object) stream))) + +(defgeneric render (obj) (:documentation "make html for thing")) + +(defmethod render ((obj steam-achievement)) + (with-slots (name description fulfillment icon icongray) obj + (with-html + (:img :src icon) + (:b name) description (:i (format-time fulfillment))))) + ;;; "queries" -(defun feats-fulfilled () - (remove-if-not #'fulfillment (db:store-objects-with-class 'feat))) +(defun feats-fulfilled (game) + (remove-if-not #'fulfillment (feats-for-game game))) |