summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'client/elm/battlemap/src/Update')
-rw-r--r--client/elm/battlemap/src/Update/DirectionRequest.elm6
-rw-r--r--client/elm/battlemap/src/Update/EndTurn.elm7
-rw-r--r--client/elm/battlemap/src/Update/SelectCharacter.elm2
3 files changed, 8 insertions, 7 deletions
diff --git a/client/elm/battlemap/src/Update/DirectionRequest.elm b/client/elm/battlemap/src/Update/DirectionRequest.elm
index 2d8b42c..477ba71 100644
--- a/client/elm/battlemap/src/Update/DirectionRequest.elm
+++ b/client/elm/battlemap/src/Update/DirectionRequest.elm
@@ -9,10 +9,9 @@ import Model
apply_to : Model.Type -> Battlemap.Direction.Type -> Model.Type
apply_to model dir =
- case (model.selection, model.navigator) of
- (Nothing, _) -> model
+ case (model.state, model.navigator) of
(_ , Nothing) -> model
- ((Just char_id), (Just nav)) ->
+ ((Model.MovingCharacter _), (Just nav)) ->
let
(new_bmap, new_nav) =
(Battlemap.Navigator.Move.to
@@ -26,3 +25,4 @@ apply_to model dir =
battlemap = new_bmap,
navigator = (Just new_nav)
}
+ (_, _) -> model
diff --git a/client/elm/battlemap/src/Update/EndTurn.elm b/client/elm/battlemap/src/Update/EndTurn.elm
index 3490d57..cc81028 100644
--- a/client/elm/battlemap/src/Update/EndTurn.elm
+++ b/client/elm/battlemap/src/Update/EndTurn.elm
@@ -44,7 +44,8 @@ update_model model nav char_id =
apply_to : Model.Type -> Model.Type
apply_to model =
- case (model.navigator, model.selection) of
+ case (model.state, model.navigator) of
(_, Nothing) -> model
- (Nothing, _) -> model
- ((Just nav), (Just char_id)) -> (update_model model nav char_id)
+ ((Model.MovingCharacter char_id), (Just nav)) ->
+ (update_model model nav char_id)
+ (_, _) -> model
diff --git a/client/elm/battlemap/src/Update/SelectCharacter.elm b/client/elm/battlemap/src/Update/SelectCharacter.elm
index b2b28ca..3fa2ab2 100644
--- a/client/elm/battlemap/src/Update/SelectCharacter.elm
+++ b/client/elm/battlemap/src/Update/SelectCharacter.elm
@@ -54,7 +54,7 @@ apply_to model char_id =
)
in
{model |
- selection = (Just char_id),
+ state = (Model.MovingCharacter char_id),
battlemap =
(
(Dict.foldl