Refector
This commit is contained in:
+4
-4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user