aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/battlemap/src/View/Controlled/Targets.elm')
-rw-r--r--src/battlemap/src/View/Controlled/Targets.elm69
1 files changed, 69 insertions, 0 deletions
diff --git a/src/battlemap/src/View/Controlled/Targets.elm b/src/battlemap/src/View/Controlled/Targets.elm
new file mode 100644
index 0000000..7bb4c36
--- /dev/null
+++ b/src/battlemap/src/View/Controlled/Targets.elm
@@ -0,0 +1,69 @@
+module View.SideBar.Targets exposing (get_html)
+
+-- Elm -------------------------------------------------------------------------
+import Dict
+
+import Html
+import Html.Attributes
+
+-- Battlemap -------------------------------------------------------------------
+import Struct.Character
+import Struct.Event
+import Struct.Model
+import Struct.Statistics
+
+--------------------------------------------------------------------------------
+-- LOCAL -----------------------------------------------------------------------
+--------------------------------------------------------------------------------
+
+get_target_info_html : (
+ Struct.Model.Type ->
+ Struct.Character.Ref ->
+ (Html.Html Struct.Event.Type)
+ )
+get_target_info_html model char_ref =
+ case (Dict.get char_ref model.characters) of
+ Nothing -> (Html.text "Error: Unknown character selected.")
+ (Just char) ->
+ (Html.text
+ (
+ "Attacking "
+ ++ char.name
+ ++ " (player "
+ ++ (Struct.Character.get_player_id char)
+ ++ "): "
+ ++
+ (toString
+ (Struct.Statistics.get_movement_points
+ (Struct.Character.get_statistics char)
+ )
+ )
+ ++ " movement points; "
+ ++ "???"
+ ++ " attack range. Health: "
+ ++ (toString (Struct.Character.get_current_health char))
+ ++ "/"
+ ++
+ (toString
+ (Struct.Statistics.get_max_health
+ (Struct.Character.get_statistics char)
+ )
+ )
+ )
+ )
+
+--------------------------------------------------------------------------------
+-- EXPORTED --------------------------------------------------------------------
+--------------------------------------------------------------------------------
+get_html : (
+ Struct.Model.Type ->
+ Struct.Character.Ref ->
+ (Html.Html Struct.Event.Type)
+ )
+get_html model target_ref =
+ (Html.div
+ [
+ (Html.Attributes.class "battlemap-side-bar-targets")
+ ]
+ [(get_target_info_html model target_ref)]
+ )