diff options
author | colin <colin@cicadas.surf> | 2023-03-05 16:36:44 -0800 |
---|---|---|
committer | colin <colin@cicadas.surf> | 2023-03-05 16:36:44 -0800 |
commit | f7abccc38ceda7024ca375d34ed88f4fb561ef02 (patch) | |
tree | 432d6673e9e8d53b5fbc43e25a684b654f6dea1d /src/transactions.lisp | |
parent | 89d0d687992b41f7f0f9b0d3da19d9d587f06010 (diff) |
Reorganized codebase
Diffstat (limited to 'src/transactions.lisp')
-rw-r--r-- | src/transactions.lisp | 22 |
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))) |