Commit before working on debugging
This commit is contained in:
+8
-6
@@ -30,13 +30,15 @@ import Data.Bifunctor
|
||||
getNodePos :: Int -> World -> Maybe Point2
|
||||
getNodePos i w = (w ^. cWorld . pathGraph) `lab` i
|
||||
|
||||
makePathUsing :: (PathEdge -> Bool) -> Point2 -> Point2 -> World -> Maybe [Int]
|
||||
makePathUsing t s e w = do
|
||||
na <- walkableNodeNear w s
|
||||
nb <- walkableNodeNear w e
|
||||
sp na nb . second _peDist
|
||||
. efilter (t . (^. _3)) $ w ^. cWorld . pathGraph
|
||||
|
||||
makePathBetween :: Point2 -> Point2 -> World -> Maybe [Int]
|
||||
makePathBetween a b w = do
|
||||
-- join $ sp <$> a' <*> b' <*> return (_pathGraph w)
|
||||
na <- walkableNodeNear w a
|
||||
nb <- walkableNodeNear w b
|
||||
sp na nb (second _peDist (efilter (not . pathEdgeObstructed . (^. _3)) $ w ^. cWorld . pathGraph))
|
||||
--_pathGraph (_cWorld w)))
|
||||
makePathBetween = makePathUsing $ not . pathEdgeObstructed
|
||||
|
||||
pathEdgeObstructed :: PathEdge -> Bool
|
||||
pathEdgeObstructed pe = DoorObstacle `Set.member` obs || BlockObstacle `Set.member` obs
|
||||
|
||||
Reference in New Issue
Block a user