add utility functions
This commit is contained in:
@@ -104,6 +104,13 @@ separate csvs."
|
||||
:if-does-not-exist :create)
|
||||
spawn-data))
|
||||
|
||||
(defun get-spawns-for-mob (mob-name &optional (ds (make-spawn-data-source)))
|
||||
(loop :for areas :in (hash-table-values (data ds))
|
||||
:append (loop :for spawn :across areas
|
||||
:when (string-equal (@ spawn "Monster") mob-name)
|
||||
collect spawn)))
|
||||
|
||||
(comment
|
||||
(defvar spawn-ds (make-spawn-data-source))
|
||||
(refresh spawn-ds))
|
||||
(data (make-spawn-data-source))
|
||||
(mapcar (partial #'gethash "MapName") (get-spawns-for-mob "Snail")))
|
||||
|
||||
Reference in New Issue
Block a user