summaryrefslogtreecommitdiff
path: root/src/game/abstract.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/abstract.lisp')
-rw-r--r--src/game/abstract.lisp47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/game/abstract.lisp b/src/game/abstract.lisp
new file mode 100644
index 0000000..f54621e
--- /dev/null
+++ b/src/game/abstract.lisp
@@ -0,0 +1,47 @@
+;;;; abstract.lisp -- classes meant to be inherited
+
+(in-package :dnd)
+
+
+;;; PERSISTENT MIXINS
+(defclass has-uid ()
+ ((nuid :reader uid
+ :initform (nuid)
+ :index-type idx:string-unique-index
+ :index-reader object-with-uid))
+ (:metaclass db:persistent-class))
+
+(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))