summaryrefslogtreecommitdiff
path: root/src/game/abstract.lisp
blob: d491dd8cc25a54256491986b941131208c4ab069 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
;;;; abstract.lisp -- classes meant to be inherited

(in-package :dnd)

;;; PERSISTENT MIXINS
(defclass can-equip ()
  ((equipment-table
    :initform nil
    :type list
    :documentation "A PLIST mapping 'equipment slots' to instances of LOOT. Equipment slots are things like :head, :torso, :left-ring, etc")
   (equipment-slot-names
    :initform +standard-humanoid-equipment+
    :initarg :slot-names
    :type (list keyword)
    :documentation "The list of slots available to this entity."))
  (:metaclass db:persistent-class))

(defclass has-bag ()
  ((bag
    :reader bag
    :initform nil
    :type list
    :documentation "A list of items that this entity is carrying."))
  (:metaclass db:persistent-class))

(defclass has-chronicle ()
  ((chronicle :accessor chronicle :initform nil))
  (:metaclass db:persistent-class)
  (:documentation "A chronicle is a general purpose log of events."))

(defparameter +standard-humanoid-equipment+
  '(:head :neck :torso :waist :legs :feet :arms :left-fingers :right-fingers
    :left-holding :right-holding :cloak)
  "The equipment slots for standard humanoids")

;;; ABSTRACT CLASSES
(defclass game-object (db:store-object has-uid has-chronicle)
  ()
  (:metaclass db:persistent-class))