[Basic reverse index from spell schools and levels to spells clinton@unknownlamer.org**20080427034451] { hunk ./src/spells.lisp 3 -(defclass spell-level () +(defclass spells-reverse-index-mixin () + ((spells :initform (make-pset) :reader spells)) + (:metaclass persistent-metaclass)) + +(defclass spell-level (spells-reverse-index-mixin) hunk ./src/spells.lisp 21 -(defclass spell-school () +(defclass spell-school (spells-reverse-index-mixin) hunk ./src/spells.lisp 31 -(defclass spell-subschool () +(defclass spell-subschool (spells-reverse-index-mixin) hunk ./src/spells.lisp 81 +(defmethod shared-initialize :after ((self spell) slot-names + &key &allow-other-keys) + (format *debug-io* "==~W==~%~A: ~A~%" + (spell-name self) + (spell-levels self) + (pset-list (spell-levels self))) + (insert-item self (spells (spell-school self))) + (map-pset (compose (curry #'insert-item self) #'spells) + (spell-levels self))) hunk ./src/spells.lisp 91 +(defmethod drop-pobject :before ((spell spell)) + (remove-item spell (spells (spell-school spell))) + (map-pset (compose (curry #'remove-item spell) #'spells) + (spell-levels spell))) }