summaryrefslogtreecommitdiff
path: root/transactions.lisp
blob: acfa8c232cc69f8e0a9b985b58994a8fbd3f6b22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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 :nick nick)))

(defun create-campaign (player title)
  (db:with-transaction ()
    (make-instance 'campaign :title title :creator player)))