Safe Haskell | None |
---|

Breadth first search and realted algorithms using the client monad.

- getCacheBfsAndPath :: forall m. MonadClient m => ActorId -> Point -> m (Array BfsDistance, Maybe [Point])
- getCacheBfs :: MonadClient m => ActorId -> m (Array BfsDistance)
- accessCacheBfs :: MonadClient m => ActorId -> Point -> m (Maybe Int)
- unexploredDepth :: MonadClient m => m (Int -> LevelId -> Bool)
- closestUnknown :: MonadClient m => ActorId -> m (Maybe Point)
- closestSuspect :: MonadClient m => ActorId -> m [Point]
- closestSmell :: MonadClient m => ActorId -> m [(Int, (Point, SmellTime))]
- furthestKnown :: MonadClient m => ActorId -> m Point
- closestTriggers :: MonadClient m => Maybe Bool -> Bool -> ActorId -> m [Point]
- closestItems :: MonadClient m => ActorId -> m [(Int, (Point, Maybe ItemBag))]
- closestFoes :: MonadClient m => [(ActorId, Actor)] -> ActorId -> m [(Int, (ActorId, Actor))]

# Documentation

getCacheBfsAndPath :: forall m. MonadClient m => ActorId -> Point -> m (Array BfsDistance, Maybe [Point])Source

Get cached BFS data and path or, if not stored, generate, store and return. Due to laziness, they are not calculated until needed.

getCacheBfs :: MonadClient m => ActorId -> m (Array BfsDistance)Source

accessCacheBfs :: MonadClient m => ActorId -> Point -> m (Maybe Int)Source

unexploredDepth :: MonadClient m => m (Int -> LevelId -> Bool)Source

closestUnknown :: MonadClient m => ActorId -> m (Maybe Point)Source

Closest reachable unknown tile position, if any.

closestSuspect :: MonadClient m => ActorId -> m [Point]Source

Closest (wrt paths) suspect tile.

closestSmell :: MonadClient m => ActorId -> m [(Int, (Point, SmellTime))]Source

Finds smells closest to the actor, except under the actor.

furthestKnown :: MonadClient m => ActorId -> m PointSource

Furthest (wrt paths) known position.

closestTriggers :: MonadClient m => Maybe Bool -> Bool -> ActorId -> m [Point]Source

Closest (wrt paths) triggerable open tiles. The second argument can ever be true only if there's no escape from the dungeon.

closestItems :: MonadClient m => ActorId -> m [(Int, (Point, Maybe ItemBag))]Source

Closest (wrt paths) items and changeable tiles (e.g., item caches).

closestFoes :: MonadClient m => [(ActorId, Actor)] -> ActorId -> m [(Int, (ActorId, Actor))]Source

Closest (wrt paths) enemy actors.