LambdaHack- A roguelike game engine in early and active development

Safe HaskellNone




The game arena comprised of levels. No operation in this module involves the State, COps, Config or Action type.


Level identifier

data LevelId Source

Level ids are, for now, ordered linearly by depth.

levelNumber :: LevelId -> IntSource

Depth of a level.

levelDefault :: Int -> LevelIdSource

Default level for a given depth.


data Dungeon Source

The complete dungeon is a map from level names to levels.

fromList :: [(LevelId, Level)] -> Int -> DungeonSource

Create a dungeon from a list of levels and maximum depth. The depth is only a danger indicator; there may potentially be multiple levels with the same depth.

currentFirst :: LevelId -> Dungeon -> [(LevelId, Level)]Source

Association list corresponding to the dungeon. Starts at the supplied level id (usually the current level) to try to speed up the searches and keep the dungeon lazy.

adjust :: (Level -> Level) -> LevelId -> Dungeon -> DungeonSource

Adjust the level at a given id.

mapDungeon :: (Level -> Level) -> Dungeon -> DungeonSource

Adjust the level at a given id.

(!) :: Dungeon -> LevelId -> LevelSource

Find a level with the given id.

lookup :: LevelId -> Dungeon -> Maybe LevelSource

Try to look up a level with the given id.

depth :: Dungeon -> IntSource

Maximum depth of the dungeon.