tracer/src/Navigation.hs

20 lines
403 B
Haskell
Raw Normal View History

module Navigation where
import Affection as A
import Data.Matrix as M
import Data.Maybe (isJust)
-- internal imports
import Types
2018-04-14 16:43:05 +00:00
import Util
isReachable :: Matrix (Maybe ImgId) -> [V2 Int] -> [ReachPoint] -> Bool
isReachable imgmat reaches exits =
2018-04-14 16:43:05 +00:00
let result =
(concatMap
2018-04-14 16:43:05 +00:00
(\exit -> map (astarAppl imgmat exit) reaches)
(map pointCoord exits))
in all isJust result