2018-04-02 14:29:35 +00:00
|
|
|
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
|
2018-04-14 16:43:05 +00:00
|
|
|
import Types.ReachPoint
|
|
|
|
import Util
|
2018-04-02 14:29:35 +00:00
|
|
|
|
|
|
|
isReachable :: Matrix (Maybe ImgId) -> [V2 Int] -> [ReachPoint] -> Bool
|
|
|
|
isReachable imgmat reaches exits =
|
2018-04-14 16:43:05 +00:00
|
|
|
let result =
|
2018-04-02 14:29:35 +00:00
|
|
|
(concatMap
|
2018-04-14 16:43:05 +00:00
|
|
|
(\exit -> map (astarAppl imgmat exit) reaches)
|
2018-04-02 14:29:35 +00:00
|
|
|
(map pointCoord exits))
|
|
|
|
in all isJust result
|