tracer/src/Navigation.hs
2018-07-03 16:19:27 +02:00

20 lines
403 B
Haskell

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