summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author0xNul <57599792+0xNul@users.noreply.github.com>2023-07-16 19:30:21 -0700
committer0xNul <57599792+0xNul@users.noreply.github.com>2023-07-22 07:50:36 -0700
commit4262be2efbbf2552ee28286c208585f8542467f7 (patch)
tree32c20e763b7980eb1dc8570cba78f74e36bd4e49 /src
parent8d3920393d3d92d70b72194f0d1bcaa2e83f190b (diff)
added kin-enhancements back to units and points list
Diffstat (limited to 'src')
-rw-r--r--src/votann/codex.clj33
-rw-r--r--src/votann/units_and_points_widget.clj13
-rw-r--r--src/votann/util.clj10
3 files changed, 16 insertions, 40 deletions
diff --git a/src/votann/codex.clj b/src/votann/codex.clj
index ea9d122..6e2cd17 100644
--- a/src/votann/codex.clj
+++ b/src/votann/codex.clj
@@ -17,37 +17,12 @@
lov/brokyr-thunderkyn
lov/hekaton-land-fortress])
-;; {:name "Uthar The Destined"
-;; :units [(Unit. "x1" 115)]}
-;; {:name "Kahl"
-;; :units [(Unit. "x1" 90)]}
-;; {:name "Einhyr Champion"
-;; :units [(Unit. "x1" 75)]}
-;; {:name "Grimnyr"
-;; :units [(Unit. "x3" 75)]}
-;; {:name "Brokhyr Iron-Master"
-;; :units [(Unit. "x3" 95)]}
-;; {:name "Hearthkyn Warriors"
-;; :units [(Unit. "x10" 135)]}
-;; {:name "Einhyr Hearthguard"
-;; :units [(Unit. "x5" 165)]}
-;; {:name "Cthonian Beserks"
-;; :units [(Unit. "x5" 135)]}
-;; {:name "Hernkyn Pioneers"
-;; :units [(Unit. "x3" 105)]}
-;; {:name "Sagitaur"
-;; :units [(Unit. "x1" 120)]}
-;; {:name "Brokhyr Thunderkyn"
-;; :units [(Unit. "x3" 95)]}
-;; {:name "Hekaton Land Fortress"
-;; :units [(Unit. "x1" 245)]}
-
(def kin-enhancements
[{:name "A Long List"
- :units [(Points. "x1" 15)]}
+ :points (Points. "x1" 15)}
{:name "Apprasing Glare"
- :units [(Points. "x1" 20)]}
+ :points (Points. "x1" 20)}
{:name "Grim Demeanour"
- :units [(Points. "x1" 20)]}
+ :points (Points. "x1" 20)}
{:name "Wayfarers Grace"
- :units [(Points. "x1" 20)]}])
+ :points (Points. "x1" 20)}])
diff --git a/src/votann/units_and_points_widget.clj b/src/votann/units_and_points_widget.clj
index be2320f..c482fd9 100644
--- a/src/votann/units_and_points_widget.clj
+++ b/src/votann/units_and_points_widget.clj
@@ -1,7 +1,16 @@
(ns votann.units-and-points-widget
- (:require [votann.util :refer [get-models]]
+ (:require [votann.codex :refer [kin-models kin-enhancements]]
[cljfx.api :as fx]))
+(def get-unit-and-points
+ (-> (map (fn [model]
+ {:name (str (:name model) " " (:count (:points model)))
+ :points (:amount (:points model))}) kin-models)
+ (concat (map (fn [enchancement]
+ {:name (str (:name enchancement) " " (:count (:points enchancement)))
+ :points (:amount (:points enchancement))}
+ ) kin-enhancements))
+ vec))
(def units-points-label-widget
{:fx/type :v-box
@@ -24,7 +33,7 @@
(def unit-points-list-widget
- (vec (for [unit get-models]
+ (vec (for [unit get-unit-and-points]
{:fx/type :v-box
:padding 5
:children [{:fx/type :label
diff --git a/src/votann/util.clj b/src/votann/util.clj
index f449d77..307f8a7 100644
--- a/src/votann/util.clj
+++ b/src/votann/util.clj
@@ -1,16 +1,8 @@
(ns votann.util
- (:require [votann.codex :refer [kin-models kin-enhancements]]
- [cljfx.lifecycle :as fx.lifecycle]
+ (:require [cljfx.lifecycle :as fx.lifecycle]
[cljfx.component :as fx.component]
[clojure.string :as string]))
-(def get-models
- (->> kin-models
- (map (fn [model]
- {:name (str (:name model) " " (:count (:points model)))
- :points (:amount (:points model))}))
- vec))
-
(defn get-resource-path [file]
(.toExternalForm (clojure.java.io/resource file)))