tracer/src/Navigation.hs
2018-10-15 00:26:12 +02:00

24 lines
478 B
Haskell

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