tracer/src/Navigation.hs
2018-04-14 18:43:05 +02:00

25 lines
526 B
Haskell

module Navigation where
import Affection as A
import Data.Matrix as M
import qualified Data.HashSet as HS
import Data.Maybe (isJust)
import Linear
-- internal imports
import Types.Map
import Types.UserData
import Types.Interior
import Types.ReachPoint
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