summaryrefslogtreecommitdiff
path: root/src/transactions.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'src/transactions.lisp')
-rw-r--r--src/transactions.lisp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/transactions.lisp b/src/transactions.lisp
new file mode 100644
index 0000000..ad9c9e8
--- /dev/null
+++ b/src/transactions.lisp
@@ -0,0 +1,22 @@
+;;;; transactions.lisp -- data store transactions for dnd
+
+(in-package :dnd)
+
+(defun birth-from-the-goddess-loins (player name)
+ (db:with-transaction ()
+ (make-instance 'hero :name name :player player)))
+
+(defun new-sesh (player)
+ (db:with-transaction () (make-instance 'session :player player)))
+
+(defun destroy-sesh (session)
+ (db:with-transaction ()
+ (db:delete-object session)))
+
+(defun register-player (nick)
+ (db:with-transaction ()
+ (make-instance 'player :nickname nick)))
+
+(defun create-campaign (player title)
+ (db:with-transaction ()
+ (make-instance 'campaign :title title :creator player)))