aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-09-22 16:08:33 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-09-22 16:08:33 +0200
commit5345adad33566e39570f067e61780e1af2dae4a7 (patch)
treefa8bf89a4c2bd1d52b1374f43f7f7e1b39fe3216
parent0dadf66e7fd4bddf8e3f7b139f94045bd0b1b462 (diff)
downloadtacticians-client-reordering.zip
tacticians-client-reordering.tar.bz2
Navigator.reset_tile t -> Tile.set_tile dir treordering
-rw-r--r--client/elm/battlemap/src/Battlemap/Navigator.elm12
-rw-r--r--client/elm/battlemap/src/Battlemap/Tile.elm8
-rw-r--r--client/elm/battlemap/src/Update/EndTurn.elm4
-rw-r--r--client/elm/battlemap/src/Update/SelectCharacter.elm4
4 files changed, 15 insertions, 13 deletions
diff --git a/client/elm/battlemap/src/Battlemap/Navigator.elm b/client/elm/battlemap/src/Battlemap/Navigator.elm
index 79f1f73..3a0ca05 100644
--- a/client/elm/battlemap/src/Battlemap/Navigator.elm
+++ b/client/elm/battlemap/src/Battlemap/Navigator.elm
@@ -1,11 +1,10 @@
module Battlemap.Navigator exposing
(
Type,
- new_navigator,
- reset_navigation
+ new_navigator
)
-import Set -- exposing (Set, member, empty, insert, remove)
+import Set
import Battlemap
import Battlemap.Direction
@@ -29,10 +28,3 @@ new_navigator start points =
previous_directions = [],
remaining_points = points
}
-
-
-reset_navigation : Battlemap.Tile.Type -> Battlemap.Tile.Type
-reset_navigation t =
- {t |
- nav_level = Battlemap.Direction.None
- }
diff --git a/client/elm/battlemap/src/Battlemap/Tile.elm b/client/elm/battlemap/src/Battlemap/Tile.elm
index dca7a64..068ee30 100644
--- a/client/elm/battlemap/src/Battlemap/Tile.elm
+++ b/client/elm/battlemap/src/Battlemap/Tile.elm
@@ -1,4 +1,4 @@
-module Battlemap.Tile exposing (Type, set_direction)
+module Battlemap.Tile exposing (Type, set_direction, set_navigation)
import Battlemap.Direction
import Character
@@ -16,3 +16,9 @@ set_direction d t =
{t |
nav_level = d
}
+
+set_navigation : Battlemap.Direction.Type -> Type -> Type
+set_navigation dir t =
+ {t |
+ nav_level = dir
+ }
diff --git a/client/elm/battlemap/src/Update/EndTurn.elm b/client/elm/battlemap/src/Update/EndTurn.elm
index 3fb479b..2e02d19 100644
--- a/client/elm/battlemap/src/Update/EndTurn.elm
+++ b/client/elm/battlemap/src/Update/EndTurn.elm
@@ -3,7 +3,9 @@ module Update.EndTurn exposing (apply_to)
import Dict
import Battlemap
+import Battlemap.Direction
import Battlemap.Navigator
+import Battlemap.Tile
import Model
@@ -25,7 +27,7 @@ update_model model nav char_id =
nav.current_location
(\t -> {t | char_level = (Just char_id)})
)
- (Battlemap.Navigator.reset_navigation)
+ (Battlemap.Tile.set_navigation Battlemap.Direction.None)
),
characters =
(Dict.update
diff --git a/client/elm/battlemap/src/Update/SelectCharacter.elm b/client/elm/battlemap/src/Update/SelectCharacter.elm
index c9c1c94..b80eda7 100644
--- a/client/elm/battlemap/src/Update/SelectCharacter.elm
+++ b/client/elm/battlemap/src/Update/SelectCharacter.elm
@@ -5,7 +5,9 @@ import Dict
import Character
import Battlemap
+import Battlemap.Direction
import Battlemap.Navigator
+import Battlemap.Tile
import Model
@@ -16,7 +18,7 @@ apply_to model char_id =
battlemap =
(Battlemap.apply_to_all_tiles
model.battlemap
- (Battlemap.Navigator.reset_navigation)
+ (Battlemap.Tile.set_navigation Battlemap.Direction.None)
),
navigator =
(case (Dict.get char_id model.characters) of