summaryrefslogtreecommitdiff |
diff options
author | nsensfel <SpamShield0@noot-noot.org> | 2017-10-17 11:04:55 +0200 |
---|---|---|
committer | nsensfel <SpamShield0@noot-noot.org> | 2017-10-17 11:04:55 +0200 |
commit | d0dc7f665ba90d126e41048b2d7b992c3e804163 (patch) | |
tree | 27c15b30b881a4320458487e1b9e6f0d14797323 /elm/battlemap/src/Battlemap/Navigator.elm | |
parent | 5a75000ec7b961ad5fe93814e5b7905cacbdba49 (diff) |
Separates Navigator from Tiles.
Diffstat (limited to 'elm/battlemap/src/Battlemap/Navigator.elm')
-rw-r--r-- | elm/battlemap/src/Battlemap/Navigator.elm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/elm/battlemap/src/Battlemap/Navigator.elm b/elm/battlemap/src/Battlemap/Navigator.elm index 9cdfc1f..2c2734d 100644 --- a/elm/battlemap/src/Battlemap/Navigator.elm +++ b/elm/battlemap/src/Battlemap/Navigator.elm @@ -11,6 +11,7 @@ module Battlemap.Navigator exposing import Dict import Battlemap.Location +import Battlemap.Direction import Battlemap.Navigator.Path import Battlemap.Navigator.RangeIndicator @@ -81,15 +82,17 @@ add_step : ( Type -> Battlemap.Direction.Type -> (Battlemap.Location.Type -> Bool) -> + (Battlemap.Location.Type -> Int) -> (Maybe Type) ) -add_step navigator dir can_cross = +add_step navigator dir can_cross cost_fun = case - (Battlemap.Navigator.Path.follow_direction + (Battlemap.Navigator.Path.try_following_direction can_cross + cost_fun (Just navigator.path) dir ) of - (Just path) -> (Just {navigator | path = path} + (Just path) -> (Just {navigator | path = path}) Nothing -> Nothing |