From 9293fb062b0bf66995c72b30e037c762318be000 Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Mon, 25 Sep 2017 16:08:43 +0200 Subject: Introduces 'States' for the model. --- client/elm/battlemap/src/Update/DirectionRequest.elm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'client/elm/battlemap/src/Update/DirectionRequest.elm') 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 -- cgit v1.2.3-70-g09d2