summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-09-27 10:31:16 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-09-27 10:31:16 +0200
commit2c9b2af9ac011a871c5c02d3e2258fca73a98880 (patch)
tree653db3959f444f1065f05658650c6ec81863d627 /client/elm/battlemap/src/Update/SelectTile.elm
parent33e57128d48a012533c42635f52037fcdedd4c56 (diff)
Splits client and server into two repositories.
Diffstat (limited to 'client/elm/battlemap/src/Update/SelectTile.elm')
-rw-r--r--client/elm/battlemap/src/Update/SelectTile.elm80
1 files changed, 0 insertions, 80 deletions
diff --git a/client/elm/battlemap/src/Update/SelectTile.elm b/client/elm/battlemap/src/Update/SelectTile.elm
deleted file mode 100644
index aa89c30..0000000
--- a/client/elm/battlemap/src/Update/SelectTile.elm
+++ /dev/null
@@ -1,80 +0,0 @@
-module Update.SelectTile exposing (apply_to)
-
-import Dict
-
-import Character
-
-import Battlemap
-import Battlemap.Direction
-import Battlemap.Location
-import Battlemap.Navigator
-import Battlemap.Tile
-import Battlemap.RangeIndicator
-
-import Update.DirectionRequest
-import Update.EndTurn
-
-import Model
-import Error
-
-autopilot : Battlemap.Direction.Type -> Model.Type -> Model.Type
-autopilot dir model =
- (Update.DirectionRequest.apply_to model dir)
-
-go_to_tile : Model.Type -> Battlemap.Location.Ref -> Model.Type
-go_to_tile model loc_ref =
- case model.selection of
- Nothing -> {model | state = (Model.Error Error.Programming)}
- (Just selection) ->
- case (Dict.get loc_ref selection.range_indicator) of
- Nothing -> {model | state = Model.Default, selection = Nothing}
- (Just indicator) ->
- let
- new_model =
- (List.foldr
- (autopilot)
- {model |
- battlemap =
- (Battlemap.apply_to_all_tiles
- model.battlemap
- (Battlemap.Tile.set_direction
- Battlemap.Direction.None
- )
- ),
- selection =
- (Just
- {
- selection |
- navigator =
- (Battlemap.Navigator.reset
- selection.navigator
- )
- }
- )
- }
- indicator.path
- )
- in
- if
- (
- (model.state == Model.MovingCharacterWithClick)
- &&
- (
- (Battlemap.Location.get_ref
- selection.navigator.current_location
- )
- == loc_ref
- )
- )
- then
- (Update.EndTurn.apply_to new_model)
- else
- {new_model | state = model.state}
-
-
-apply_to : Model.Type -> Battlemap.Location.Ref -> Model.Type
-apply_to model loc_ref =
- case model.state of
- Model.MovingCharacterWithButtons -> (go_to_tile model loc_ref)
- Model.MovingCharacterWithClick -> (go_to_tile model loc_ref)
- _ -> {model | state = (Model.Error Error.IllegalAction)}