summaryrefslogtreecommitdiff
path: root/serialization.lisp
diff options
context:
space:
mode:
authorGrant Shoshin Shangreaux <shoshin@cicadas.surf>2023-01-07 09:39:46 -0600
committerGrant Shoshin Shangreaux <shoshin@cicadas.surf>2023-01-07 09:39:46 -0600
commit9a040d4e78ab07eb9c482a40042f2ba92d2a8e3b (patch)
tree5286e5283238995a1500a2a5bc71cbd24255bc46 /serialization.lisp
parentee7919667832660ef05939823af5516eb9344e16 (diff)
Revert "Add: serialization for Heroes and dnd.api package"
This reverts commit 72bcf7e66269af588d9daa9064de23d257cbd053.
Diffstat (limited to 'serialization.lisp')
-rw-r--r--serialization.lisp25
1 files changed, 9 insertions, 16 deletions
diff --git a/serialization.lisp b/serialization.lisp
index d1689c1..6579b92 100644
--- a/serialization.lisp
+++ b/serialization.lisp
@@ -1,20 +1,13 @@
;;;; serialization.lisp
-(in-package :dnd.api)
-(defmacro with-json-object (&body pairs)
- (list*
- 'json:with-object
- (loop for (key val . more) on pairs by #'cddr
- collect `(json:write-key-value ,key ,val))))
-(defmethod json:%to-json ((hero hero))
- (with-slots (name experience chronicle uid equipment-table) hero
- (with-json-object
- :|name| name
- :|experience| experience
- :|chronicle| chronicle
- :|uid| uid
- :|renown| (renown hero)
- :|title| (hero-title hero)
- :|class| (hero-class hero))))
+(in-package :dnd)
+
+(defun hall-of-fame-hero-view (hero)
+ (json:to-json
+ (list :name (hero-name hero)
+ :uid (uid hero)
+ :renown (renown hero)
+ :title (hero-title hero)
+ :class (hero-class hero))))