From 33e57128d48a012533c42635f52037fcdedd4c56 Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Tue, 26 Sep 2017 19:13:04 +0200 Subject: Range indicators are now clickable. --- client/elm/battlemap/src/Battlemap/Navigator.elm | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'client/elm/battlemap/src/Battlemap/Navigator.elm') diff --git a/client/elm/battlemap/src/Battlemap/Navigator.elm b/client/elm/battlemap/src/Battlemap/Navigator.elm index 3a0ca05..b040013 100644 --- a/client/elm/battlemap/src/Battlemap/Navigator.elm +++ b/client/elm/battlemap/src/Battlemap/Navigator.elm @@ -1,7 +1,8 @@ module Battlemap.Navigator exposing ( Type, - new_navigator + new, + reset ) import Set @@ -17,14 +18,27 @@ type alias Type = current_location : Battlemap.Location.Type, visited_locations : (Set.Set Battlemap.Location.Ref), previous_directions : (List Battlemap.Direction.Type), - remaining_points : Int + remaining_points : Int, + starting_location : Battlemap.Location.Type, + starting_points : Int } -new_navigator : Battlemap.Location.Type -> Int -> Type -new_navigator start points = +new : Battlemap.Location.Type -> Int -> Type +new start points = { current_location = start, visited_locations = Set.empty, previous_directions = [], - remaining_points = points + remaining_points = points, + starting_location = start, + starting_points = points + } + +reset : Type -> Type +reset nav = + {nav | + current_location = nav.starting_location, + visited_locations = Set.empty, + previous_directions = [], + remaining_points = nav.starting_points } -- cgit v1.2.3-70-g09d2