Safe Haskell | None |
---|---|

Language | Haskell2010 |

Breadth first search and realted algorithms using the client monad.

- invalidateBfs :: ActorId -> EnumMap ActorId (Bool, Array BfsDistance, Point, Int, Maybe [Point]) -> EnumMap ActorId (Bool, Array BfsDistance, Point, Int, Maybe [Point])
- 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 -> ActorId -> m (Frequency Point)
- closestItems :: MonadClient m => ActorId -> m [(Int, (Point, Maybe ItemBag))]
- closestFoes :: MonadClient m => [(ActorId, Actor)] -> ActorId -> m [(Int, (ActorId, Actor))]

# Documentation

invalidateBfs :: ActorId -> EnumMap ActorId (Bool, Array BfsDistance, Point, Int, Maybe [Point]) -> EnumMap ActorId (Bool, Array BfsDistance, Point, Int, Maybe [Point]) Source

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 Point Source

Furthest (wrt paths) known position.

closestTriggers :: MonadClient m => Maybe Bool -> ActorId -> m (Frequency Point) Source

Closest (wrt paths) triggerable open tiles. The level the actor is on is either explored or the actor already has a weapon equipped, so no need to explore further, he tries to find enemies on other levels.

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.