2018-04-02 14:29:35 +00:00
|
|
|
module Navigation where
|
|
|
|
|
|
|
|
import Affection as A
|
|
|
|
|
|
|
|
import Data.Matrix as M
|
2018-10-14 22:26:12 +00:00
|
|
|
import Data.Maybe (isJust, catMaybes)
|
2018-04-02 14:29:35 +00:00
|
|
|
|
|
|
|
-- internal imports
|
|
|
|
|
2018-06-04 03:29:20 +00:00
|
|
|
import Types
|
2018-04-14 16:43:05 +00:00
|
|
|
import Util
|
2018-04-02 14:29:35 +00:00
|
|
|
|
2018-07-21 19:10:32 +00:00
|
|
|
isReachable
|
|
|
|
:: Matrix (Maybe ImgId)
|
|
|
|
-> [(V2 Double, Boundaries Double)]
|
|
|
|
-> [V2 Int]
|
|
|
|
-> [ReachPoint]
|
|
|
|
-> Bool
|
|
|
|
isReachable imgmat animBounds reaches exits =
|
2018-04-14 16:43:05 +00:00
|
|
|
let result =
|
2018-09-02 08:44:33 +00:00
|
|
|
concatMap
|
|
|
|
((\exit -> map (astarAppl imgmat animBounds exit) reaches) . pointCoord)
|
|
|
|
exits
|
2018-04-02 14:29:35 +00:00
|
|
|
in all isJust result
|