summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-09-22 13:46:32 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-09-22 13:46:32 +0200
commit2d20dc042a386bc9f66bc5f535403227f9acf1b1 (patch)
tree49e529ff4e12841d160627d9853c088ba0dd637b /client/elm/battlemap/src/Shim
parent0d5fba42a1597e5a43266c071776e7acf58071e2 (diff)
No more import ... exposing.
It got too confusing.
Diffstat (limited to 'client/elm/battlemap/src/Shim')
-rw-r--r--client/elm/battlemap/src/Shim/Battlemap.elm11
-rw-r--r--client/elm/battlemap/src/Shim/Battlemap/Tile.elm40
-rw-r--r--client/elm/battlemap/src/Shim/Model.elm50
3 files changed, 101 insertions, 0 deletions
diff --git a/client/elm/battlemap/src/Shim/Battlemap.elm b/client/elm/battlemap/src/Shim/Battlemap.elm
new file mode 100644
index 0000000..820ceec
--- /dev/null
+++ b/client/elm/battlemap/src/Shim/Battlemap.elm
@@ -0,0 +1,11 @@
+module Shim.Battlemap exposing (generate)
+
+import Shim.Battlemap.Tile
+
+--generate : Battlemap.Type
+generate =
+ {
+ width = 6,
+ height = 6,
+ content = (Shim.Battlemap.Tile.generate)
+ }
diff --git a/client/elm/battlemap/src/Shim/Battlemap/Tile.elm b/client/elm/battlemap/src/Shim/Battlemap/Tile.elm
new file mode 100644
index 0000000..e3ab7bb
--- /dev/null
+++ b/client/elm/battlemap/src/Shim/Battlemap/Tile.elm
@@ -0,0 +1,40 @@
+module Shim.Battlemap.Tile exposing (generate)
+
+import Array
+import List
+
+import Battlemap.Direction
+import Battlemap.Tile
+
+from_int : Int -> Battlemap.Tile.Type
+from_int i =
+ if (i >= 10)
+ then
+ {
+ floor_level = (i - 10),
+ nav_level = Battlemap.Direction.None,
+ char_level = (Just (toString (i - 10)))
+ }
+ else
+ {
+ floor_level = i,
+ nav_level = Battlemap.Direction.None,
+ char_level = Nothing
+ }
+
+
+generate : (Array.Array Battlemap.Tile.Type)
+generate =
+ (Array.fromList
+ (List.map
+ (from_int)
+ [
+ 10, 1, 1, 2, 2, 2,
+ 1, 0, 0, 0, 11, 2,
+ 1, 0, 1, 2, 0, 2,
+ 3, 0, 3, 4, 0, 4,
+ 3, 12, 0, 0, 0, 4,
+ 3, 3, 3, 4, 4, 4
+ ]
+ )
+ )
diff --git a/client/elm/battlemap/src/Shim/Model.elm b/client/elm/battlemap/src/Shim/Model.elm
new file mode 100644
index 0000000..517f80d
--- /dev/null
+++ b/client/elm/battlemap/src/Shim/Model.elm
@@ -0,0 +1,50 @@
+module Shim.Model exposing (generate)
+
+import Dict
+
+--import Model
+
+import Shim.Battlemap
+
+--generate : Model.Type
+generate =
+ {
+ battlemap = (Shim.Battlemap.generate),
+ navigator = Nothing,
+ selection = Nothing,
+ characters =
+ (Dict.insert
+ "2"
+ {
+ id = "2",
+ name = "Char2",
+ icon = "Icon2",
+ portrait = "Portrait2",
+ location = {x = 1, y = 4},
+ movement_points = 6
+ }
+ (Dict.insert
+ "1"
+ {
+ id = "1",
+ name = "Char1",
+ icon = "Icon1",
+ portrait = "Portrait1",
+ location = {x = 4, y = 1},
+ movement_points = 10
+ }
+ (Dict.insert
+ "0"
+ {
+ id = "0",
+ name = "Char0",
+ icon = "Icon0",
+ portrait = "Portrait0",
+ location = {x = 0, y = 0},
+ movement_points = 16
+ }
+ Dict.empty
+ )
+ )
+ )
+ }