summaryrefslogtreecommitdiff |
diff options
author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-10-18 20:59:41 +0200 |
---|---|---|
committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-10-18 20:59:41 +0200 |
commit | 96d7905f7faef941f5454fd2c8b0b50a294fd26c (patch) | |
tree | 77377c56ed005fc56dcaad506f0f12bb598fef66 /elm/battlemap/src/Battlemap/Navigator.elm | |
parent | 2805c647010cbcca126ebf162fcbdd691fc72488 (diff) |
Borked mouse controls for the navigator, it seems.
Diffstat (limited to 'elm/battlemap/src/Battlemap/Navigator.elm')
-rw-r--r-- | elm/battlemap/src/Battlemap/Navigator.elm | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/elm/battlemap/src/Battlemap/Navigator.elm b/elm/battlemap/src/Battlemap/Navigator.elm index ac394b5..6687b18 100644 --- a/elm/battlemap/src/Battlemap/Navigator.elm +++ b/elm/battlemap/src/Battlemap/Navigator.elm @@ -1,10 +1,12 @@ module Battlemap.Navigator exposing ( Type, + Summary, new, get_current_location, get_remaining_points, get_range_markers, + get_summary, try_adding_step, try_getting_path_to ) @@ -13,6 +15,7 @@ import Dict import Battlemap.Location import Battlemap.Direction +import Battlemap.Marker import Battlemap.Navigator.Path import Battlemap.Navigator.RangeIndicator @@ -33,6 +36,12 @@ type alias Type = ) } +type alias Summary = + { + starting_location: Battlemap.Location.Type, + path: (List Battlemap.Direction.Type), + markers: (List (Battlemap.Location.Ref, Battlemap.Marker.Type)) + } -------------------------------------------------------------------------------- -- LOCAL ----------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -79,6 +88,27 @@ get_range_markers : ( ) get_range_markers navigator = (Dict.toList navigator.range_indicators) +get_summary : Type -> Summary +get_summary navigator = + { + starting_location = navigator.starting_location, + path = (Battlemap.Navigator.Path.get_summary navigator.path), + markers = + (List.map + (\(loc, range_indicator) -> + ( + loc, + (Battlemap.Navigator.RangeIndicator.get_marker + range_indicator + ) + ) + ) + (Dict.toList + navigator.range_indicators + ) + ) + } + try_adding_step : ( Type -> Battlemap.Direction.Type -> @@ -108,3 +138,4 @@ try_getting_path_to navigator loc_ref = (Just target) -> (Just (Battlemap.Navigator.RangeIndicator.get_path target)) Nothing -> Nothing + |