summaryrefslogtreecommitdiff
path: root/model.lisp
diff options
context:
space:
mode:
authorColin Okay <colin@cicadas.surf>2022-12-26 14:13:22 -0800
committerColin Okay <colin@cicadas.surf>2022-12-26 14:13:22 -0800
commit8e7fc055823fde522fb83f9a7d86dcba39dcf551 (patch)
tree85d2b529712c0e40df8a19ee1bbaf31e79387eb9 /model.lisp
initial commit; Add hero model definition
Diffstat (limited to 'model.lisp')
-rw-r--r--model.lisp81
1 files changed, 81 insertions, 0 deletions
diff --git a/model.lisp b/model.lisp
new file mode 100644
index 0000000..318aa26
--- /dev/null
+++ b/model.lisp
@@ -0,0 +1,81 @@
+;;;; model.lisp -- bknr.datastore class definitions for dnd
+
+ty
+
+(in-package :dungeons-and-deadlines)
+
+(deftype title ()
+ `(member :noob))
+
+(deftype character-class ()
+ `(member :hero))
+
+(defclass has-uid (db:store-object)
+ ((nuid :reader uid :initform (nuid)))
+ (:metaclass db:persistent-class))
+
+(defclass can-equip (db:store-object)
+ ((equipment-slots
+ :initform (make-hash-table))
+ (equipment-slot-names
+ :initform (list :holding)
+ :initarg :slot-names
+ :type (list keyword)))
+ (:metaclass db:persistent-class))
+
+;; TODO: define an equip protocol
+
+;; a user
+(defclass hero (can-equip has-uid)
+ ((name
+ :accessor hero-name
+ :initarg :name
+ :initform (error "Heroes must be named")
+ :type string
+ :index-type idx:string-unique-index
+ :index-reader hero-known-as)
+ (experience
+ :accessor experience
+ :initform 0
+ :type integer)
+ (chronicle
+ :accessor hero-chronicle
+ :initform (list)
+ :type (cons string))
+ (pwhash
+ :accessor pwhash
+ :type string
+ :initarg :pwhash
+ :documentation "A hash of the password, hashed with the value of the pwsalt slot.")
+ (pwsalt
+ :reader pwsalt
+ :initform (nuid)
+ :type string
+ :documentation "Salt for this hero's password hash."))
+ (:metaclass db:persistent-class))
+
+;; aka an issue
+;; (defclass monster (can-equip has-uid)
+;; ((name)
+;; (description)
+;; (difficulty)
+;; (tags)
+;; (status)
+;; (priority)
+;; )
+;; (:metaclass db:persistent-class))
+
+;; (defun experience-value (monster)
+;; ;; Int
+;; ;; (tag + campaign) - lookup table , priortiy,
+;; )
+
+;; ;; aka .... uhh.... dumbass github flair
+;; (defclass loot (db:store-object)
+;; ()
+;; (:metaclass db:persistent-class))
+
+;; ;; aka a project
+;; (defclass campagin (db:store-object)
+;; ()
+;; (:metaclass db:persistent-class))