summaryrefslogtreecommitdiff |
diff options
author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-09-27 10:31:16 +0200 |
---|---|---|
committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-09-27 10:31:16 +0200 |
commit | 2c9b2af9ac011a871c5c02d3e2258fca73a98880 (patch) | |
tree | 653db3959f444f1065f05658650c6ec81863d627 /elm/battlemap/src/Battlemap/Navigator.elm | |
parent | 33e57128d48a012533c42635f52037fcdedd4c56 (diff) |
Splits client and server into two repositories.
Diffstat (limited to 'elm/battlemap/src/Battlemap/Navigator.elm')
-rw-r--r-- | elm/battlemap/src/Battlemap/Navigator.elm | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/elm/battlemap/src/Battlemap/Navigator.elm b/elm/battlemap/src/Battlemap/Navigator.elm new file mode 100644 index 0000000..b040013 --- /dev/null +++ b/elm/battlemap/src/Battlemap/Navigator.elm @@ -0,0 +1,44 @@ +module Battlemap.Navigator exposing + ( + Type, + new, + reset + ) + +import Set + +import Battlemap +import Battlemap.Direction +import Battlemap.Location +import Battlemap.Tile + + +type alias Type = + { + current_location : Battlemap.Location.Type, + visited_locations : (Set.Set Battlemap.Location.Ref), + previous_directions : (List Battlemap.Direction.Type), + remaining_points : Int, + starting_location : Battlemap.Location.Type, + starting_points : Int + } + +new : Battlemap.Location.Type -> Int -> Type +new start points = + { + current_location = start, + visited_locations = Set.empty, + previous_directions = [], + 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 + } |