summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'elm/battlemap/src/View')
-rw-r--r--elm/battlemap/src/View/Battlemap.elm78
-rw-r--r--elm/battlemap/src/View/Battlemap/Navigator.elm17
-rw-r--r--elm/battlemap/src/View/Battlemap/Tile.elm39
-rw-r--r--elm/battlemap/src/View/Controls.elm36
-rw-r--r--elm/battlemap/src/View/Status.elm52
5 files changed, 0 insertions, 222 deletions
diff --git a/elm/battlemap/src/View/Battlemap.elm b/elm/battlemap/src/View/Battlemap.elm
deleted file mode 100644
index efe4d1e..0000000
--- a/elm/battlemap/src/View/Battlemap.elm
+++ /dev/null
@@ -1,78 +0,0 @@
-module View.Battlemap exposing (get_html)
-
-import Array
-
-import List
-
-import Html
-import Html.Attributes
-import Html.Events
-
-import Battlemap
-
-import Character
-
-import View.Battlemap.Tile
-import View.Battlemap.Navigator
-
-import Event
---------------------------------------------------------------------------------
--- LOCAL -----------------------------------------------------------------------
---------------------------------------------------------------------------------
-char_on_map : Int -> Character.Type -> (Html.Html Event.Type)
-char_on_map tile_size char =
- let
- char_loc = (Character.get_location char)
- in
- (Html.div
- [
- (Html.Attributes.class "battlemap-character-icon"),
- (Html.Attributes.class
- ("asset-character-icon-" ++ (Character.get_icon_id char))
- ),
- (Html.Events.onClick
- (Event.CharacterSelected (Character.get_ref char))
- ),
- (Html.Attributes.style
- [
- ("top", ((toString (char_loc.y * tile_size)) ++ "px")),
- ("left", ((toString (char_loc.x * tile_size)) ++ "px"))
- ]
- )
- ]
- [
- ]
- )
-
---------------------------------------------------------------------------------
--- EXPORTED --------------------------------------------------------------------
---------------------------------------------------------------------------------
-get_html : (
- Battlemap.Type ->
- Int ->
- (List Character.Type) ->
- (Html.Html Event.Type)
- )
-get_html battlemap tile_size characters =
- (Html.div
- [
- (Html.Attributes.class "battlemap-container")
- ]
- (
- (List.map
- (View.Battlemap.Tile.get_html tile_size)
- (Array.toList (Battlemap.get_tiles battlemap))
- )
- ++
- (List.map
- (char_on_map tile_size)
- characters
- )
- ++
- case (Battlemap.try_getting_navigator_summary battlemap) of
- (Just nav_summary) ->
- (View.Battlemap.Navigator.get_html tile_size nav_summary)
-
- Nothing -> [(Html.text "")]
- )
- )
diff --git a/elm/battlemap/src/View/Battlemap/Navigator.elm b/elm/battlemap/src/View/Battlemap/Navigator.elm
deleted file mode 100644
index 4180e6d..0000000
--- a/elm/battlemap/src/View/Battlemap/Navigator.elm
+++ /dev/null
@@ -1,17 +0,0 @@
-module View.Battlemap.Navigator exposing (get_html)
-
-import Html
---import Html.Attributes
---import Html.Events
-
---import Battlemap.Location
-import Battlemap.Navigator
-
-import Event
-
-get_html : (
- Int ->
- Battlemap.Navigator.Summary ->
- (List (Html.Html Event.Type))
- )
-get_html tile_size nav_summary = []
diff --git a/elm/battlemap/src/View/Battlemap/Tile.elm b/elm/battlemap/src/View/Battlemap/Tile.elm
deleted file mode 100644
index d38d84e..0000000
--- a/elm/battlemap/src/View/Battlemap/Tile.elm
+++ /dev/null
@@ -1,39 +0,0 @@
-module View.Battlemap.Tile exposing (get_html)
-
-import Html
-import Html.Attributes
-import Html.Events
-
-import Battlemap.Tile
-import Battlemap.Location
-
-import Event
-
-get_html : (
- Int ->
- Battlemap.Tile.Type ->
- (Html.Html Event.Type)
- )
-get_html tile_size tile =
- let
- tile_loc = (Battlemap.Tile.get_location tile)
- in
- (Html.div
- [
- (Html.Attributes.class "battlemap-tile-icon"),
- (Html.Attributes.class
- ("asset-tile-" ++ (toString (Battlemap.Tile.get_icon_id tile)))
- ),
- (Html.Events.onClick
- (Event.TileSelected (Battlemap.Location.get_ref tile_loc))
- ),
- (Html.Attributes.style
- [
- ("top", ((toString (tile_loc.y * tile_size)) ++ "px")),
- ("left", ((toString (tile_loc.x * tile_size)) ++ "px"))
- ]
- )
- ]
- [
- ]
- )
diff --git a/elm/battlemap/src/View/Controls.elm b/elm/battlemap/src/View/Controls.elm
deleted file mode 100644
index f5851a9..0000000
--- a/elm/battlemap/src/View/Controls.elm
+++ /dev/null
@@ -1,36 +0,0 @@
-module View.Controls exposing (view)
-
-import Html
-import Html.Events
-
-import Battlemap.Direction
-
-import Event
-
-direction_button : Battlemap.Direction.Type -> String -> (Html.Html Event.Type)
-direction_button dir label =
- (Html.button
- [
- (Html.Events.onClick
- (Event.DirectionRequested dir)
- )
- ]
- [ (Html.text label) ]
- )
-
-end_turn_button : (Html.Html Event.Type)
-end_turn_button =
- (Html.button
- [ (Html.Events.onClick Event.TurnEnded) ]
- [ (Html.text "End Turn") ]
- )
-
-view : (List (Html.Html Event.Type))
-view =
- [
- (direction_button Battlemap.Direction.Left "Left"),
- (direction_button Battlemap.Direction.Down "Down"),
- (direction_button Battlemap.Direction.Up "Up"),
- (direction_button Battlemap.Direction.Right "Right"),
- (end_turn_button)
- ]
diff --git a/elm/battlemap/src/View/Status.elm b/elm/battlemap/src/View/Status.elm
deleted file mode 100644
index de2a167..0000000
--- a/elm/battlemap/src/View/Status.elm
+++ /dev/null
@@ -1,52 +0,0 @@
-module View.Status exposing (view)
-
-import Dict
-
-import Html
-
-import Battlemap
-import Character
-
-import Error
-import Event
-import Model
-
-moving_character_text : Model.Type -> String
-moving_character_text model =
- case model.selection of
- (Model.SelectedCharacter char_id) ->
- case (Dict.get char_id model.characters) of
- Nothing -> "Error: Unknown character selected."
- (Just char) ->
- (
- "Controlling "
- ++ char.name
- ++ ": "
- ++ (toString
- (Battlemap.get_navigator_remaining_points
- model.battlemap
- )
- )
- ++ "/"
- ++ (toString (Character.get_movement_points char))
- ++ " movement points remaining."
- )
- _ -> "Error: model.selection does not match its state."
-
-view : Model.Type -> (Html.Html Event.Type)
-view model =
- (Html.text
- (
- (case model.state of
- Model.Default -> "Click on a character to control it."
- Model.MovingCharacterWithButtons -> (moving_character_text model)
- Model.MovingCharacterWithClick -> (moving_character_text model)
- Model.FocusingTile -> "Error: Unimplemented."
- )
- ++ " " ++
- (case model.error of
- Nothing -> ""
- (Just error) -> (Error.to_string error)
- )
- )
- )