summaryrefslogtreecommitdiff
path: root/queries.lisp
diff options
context:
space:
mode:
authorcolin <colin@cicadas.surf>2023-03-05 16:36:44 -0800
committercolin <colin@cicadas.surf>2023-03-05 16:36:44 -0800
commitf7abccc38ceda7024ca375d34ed88f4fb561ef02 (patch)
tree432d6673e9e8d53b5fbc43e25a684b654f6dea1d /queries.lisp
parent89d0d687992b41f7f0f9b0d3da19d9d587f06010 (diff)
Reorganized codebase
Diffstat (limited to 'queries.lisp')
-rw-r--r--queries.lisp26
1 files changed, 0 insertions, 26 deletions
diff --git a/queries.lisp b/queries.lisp
deleted file mode 100644
index 4538c75..0000000
--- a/queries.lisp
+++ /dev/null
@@ -1,26 +0,0 @@
-;;;; queries.lisp -- query the database
-
-(in-package :dnd)
-
-(defun all-heroes ()
- (db:store-objects-with-class 'hero))
-
-(defun player-campaigns (player)
- "Return a list of campaigns that that player is involved in."
- (remove nil (mapcar #'hero-campaign (player-heroes player))))
-
-(defun campaign-heros (campaign &key (activep t))
- "All the heros actively involved in this CAMPAIGN. If ACTIVEP, then
-only the active quest(s) are considered, otherwise all quests are considered."
- (remove-duplicates
- (mapcan #'heroes-on-quest
- (if activep
- (remove-if-not #'quest-startedp (quests-in-campaign campaign))
- (quests-in-campaign campaign)))))
-
-(defun fetch-comrades (player &key (activep t))
- "Returns all the heroes in any one of the player's campaigns. If
-ACTIVEP, then only heroes involved in active quests are returned."
- (remove-duplicates
- (loop :for campaign :in (player-campaigns player)
- :nconc (campaign-heros campaign :activep activep))))