This commit is contained in:
2021-05-05 17:36:10 +02:00
parent f0e5095b5f
commit 05086d6f4a
29 changed files with 760 additions and 766 deletions
+4 -4
View File
@@ -147,14 +147,14 @@ makePathBetweenPs' a b w = fmap (mapMaybe (lab g)) $ makePathBetween' a b w
where g = _pathGraph w
pointTowardsGoal :: Point2 -> Point2 -> World -> Maybe Point2
pointTowardsGoal a b w = join $ fmap (listToMaybe . filter (flip (isWalkable a) w))
pointTowardsImpulse :: Point2 -> Point2 -> World -> Maybe Point2
pointTowardsImpulse a b w = join $ fmap (listToMaybe . filter (flip (isWalkable a) w))
-- $ pathBetween a b w
$ makePathBetweenPs a b w
--
pointTowardsGoal' :: Point2 -> Point2 -> World -> Either String Point2
pointTowardsGoal' a b w = join $ fmap (maybeToEither "NOSEEPATH" . listToMaybe . filter (flip (isWalkable a) w))
pointTowardsImpulse' :: Point2 -> Point2 -> World -> Either String Point2
pointTowardsImpulse' a b w = join $ fmap (maybeToEither "NOSEEPATH" . listToMaybe . filter (flip (isWalkable a) w))
$ makePathBetweenPs' b a w
maybeToEither :: a -> Maybe b -> Either a b