| summaryrefslogtreecommitdiff | 
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-09-18 18:15:59 +0200 | 
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-09-18 18:15:59 +0200 | 
| commit | 0b9096ed0c66db403c244a4720bac60326a40394 (patch) | |
| tree | 233d01b0b04463c3c8db7e20f3c3152f73427a34 /client/elm/battlemap/src/Battlemap/Navigator.elm | |
| parent | c9786fd27954c79faf901963003a8b7b3131ca4c (diff) | |
Character-focused navigators.
Diffstat (limited to 'client/elm/battlemap/src/Battlemap/Navigator.elm')
| -rw-r--r-- | client/elm/battlemap/src/Battlemap/Navigator.elm | 30 | 
1 files changed, 25 insertions, 5 deletions
| diff --git a/client/elm/battlemap/src/Battlemap/Navigator.elm b/client/elm/battlemap/src/Battlemap/Navigator.elm index b040676..df0e2cf 100644 --- a/client/elm/battlemap/src/Battlemap/Navigator.elm +++ b/client/elm/battlemap/src/Battlemap/Navigator.elm @@ -1,16 +1,29 @@ -module Battlemap.Navigator exposing (Navigator, new_navigator, go) +module Battlemap.Navigator exposing +   ( +      Navigator, +      new_navigator, +      reset_navigation, +      go +   )  import Set exposing (Set, member, empty, insert)  import Battlemap exposing (Battlemap, has_location, apply_to_tile) -import Battlemap.Location exposing (..) -import Battlemap.Direction exposing (..) -import Battlemap.Tile exposing (set_direction) +import Battlemap.Direction exposing (Direction(..)) +import Battlemap.Tile exposing (Tile, set_direction) + +import Battlemap.Location exposing +   ( +      Location, +      LocationRef, +      neighbor, +      to_comparable +   )  type alias Navigator =     {        current_location : Location, -      visited_locations : (Set LocationComparable) +      visited_locations : (Set LocationRef)     }  new_navigator : Location -> Navigator @@ -20,6 +33,13 @@ new_navigator start =        visited_locations = empty     } + +reset_navigation : Tile -> Tile +reset_navigation t = +   {t | +      nav_level = None +   } +  go : Battlemap -> Navigator -> Direction -> (Battlemap, Navigator)  go battlemap nav dir =     let | 


