Use a centralized function to determine how to deal with objects used in entity macros

This commit is contained in:
oakes
2014-01-19 03:37:18 -05:00
parent a17d0ceb79
commit 6bac86a94f
5 changed files with 65 additions and 58 deletions

View File

@@ -4,11 +4,18 @@
[com.badlogic.gdx.scenes.scene2d Actor]
[com.badlogic.gdx.utils Array ArrayMap]))
; exceptions
; misc
(defn throw-key-not-found
[k]
(throw (Exception. (str "The keyword " k " is not supported."))))
(throw (Exception. (str "The keyword " k " is not found."))))
(defn get-obj
[obj k]
(if (map? obj)
(or (get obj k)
(throw-key-not-found k))
obj))
; converting keys