Safe Haskell | None |
---|---|
Language | Haskell2010 |
Operations concerning dungeon level tiles.
Unlike for many other content types, there is no type Tile
,
of particular concrete tiles in the dungeon,
corresponding to TileKind
(the type of kinds of terrain tiles).
This is because the tiles are too numerous and there's not enough
storage space for a well-rounded Tile
type, on one hand,
and on the other hand, tiles are accessed
too often in performance critical code
to try to compress their representation and/or recompute them.
Instead, of defining a Tile
type, we express various properties
of concrete tiles by arrays or sparse EnumMaps, as appropriate.
Actors at normal speed (2 m/s) take one turn to move one tile (1 m by 1 m).
- kindHasFeature :: Feature -> TileKind -> Bool
- hasFeature :: Ops TileKind -> Feature -> Id TileKind -> Bool
- isClear :: TileSpeedup -> Id TileKind -> Bool
- isLit :: TileSpeedup -> Id TileKind -> Bool
- isWalkable :: TileSpeedup -> Id TileKind -> Bool
- isDoor :: TileSpeedup -> Id TileKind -> Bool
- isChangable :: TileSpeedup -> Id TileKind -> Bool
- isSuspect :: TileSpeedup -> Id TileKind -> Bool
- isHideAs :: TileSpeedup -> Id TileKind -> Bool
- consideredByAI :: TileSpeedup -> Id TileKind -> Bool
- isExplorable :: TileSpeedup -> Id TileKind -> Bool
- isOftenItem :: TileSpeedup -> Id TileKind -> Bool
- isOftenActor :: TileSpeedup -> Id TileKind -> Bool
- isNoItem :: TileSpeedup -> Id TileKind -> Bool
- isNoActor :: TileSpeedup -> Id TileKind -> Bool
- isEasyOpen :: TileSpeedup -> Id TileKind -> Bool
- speedup :: Bool -> Ops TileKind -> TileSpeedup
- alterMinSkill :: TileSpeedup -> Id TileKind -> Int
- alterMinWalk :: TileSpeedup -> Id TileKind -> Int
- openTo :: Ops TileKind -> Id TileKind -> Rnd (Id TileKind)
- closeTo :: Ops TileKind -> Id TileKind -> Rnd (Id TileKind)
- embeddedItems :: Ops TileKind -> Id TileKind -> [GroupName ItemKind]
- revealAs :: Ops TileKind -> Id TileKind -> Rnd (Id TileKind)
- obscureAs :: Ops TileKind -> Id TileKind -> Rnd (Id TileKind)
- hideAs :: Ops TileKind -> Id TileKind -> Id TileKind
- buildAs :: Ops TileKind -> Id TileKind -> Id TileKind
- isEasyOpenKind :: TileKind -> Bool
- isOpenable :: Ops TileKind -> Id TileKind -> Bool
- isClosable :: Ops TileKind -> Id TileKind -> Bool
- createTab :: Unbox a => Ops TileKind -> (TileKind -> a) -> Tab a
- createTabWithKey :: Unbox a => Ops TileKind -> (Id TileKind -> TileKind -> a) -> Tab a
- accessTab :: Unbox a => Tab a -> Id TileKind -> a
Documentation
hasFeature :: Ops TileKind -> Feature -> Id TileKind -> Bool Source #
Whether a tile kind (specified by its id) has the given feature.
isClear :: TileSpeedup -> Id TileKind -> Bool Source #
Whether a tile does not block vision. Essential for efficiency of FOV, hence tabulated.
isLit :: TileSpeedup -> Id TileKind -> Bool Source #
Whether a tile has ambient light --- is lit on its own. Essential for efficiency of Perception, hence tabulated.
isWalkable :: TileSpeedup -> Id TileKind -> Bool Source #
Whether actors can walk into a tile. Essential for efficiency of pathfinding, hence tabulated.
isDoor :: TileSpeedup -> Id TileKind -> Bool Source #
Whether a tile is a door, open or closed. Essential for efficiency of pathfinding, hence tabulated.
isChangable :: TileSpeedup -> Id TileKind -> Bool Source #
Whether a tile is changable.
isSuspect :: TileSpeedup -> Id TileKind -> Bool Source #
Whether a tile is suspect. Essential for efficiency of pathfinding, hence tabulated.
consideredByAI :: TileSpeedup -> Id TileKind -> Bool Source #
isExplorable :: TileSpeedup -> Id TileKind -> Bool Source #
Whether one can easily explore a tile, possibly finding a treasure or a clue. Doors can't be explorable since revealing a secret tile should not change it's (walkable and) explorable status. Door status should not depend on whether they are open or not so that a foe opening a door doesn't force us to backtrack to explore it.
isOftenItem :: TileSpeedup -> Id TileKind -> Bool Source #
isOftenActor :: TileSpeedup -> Id TileKind -> Bool Source #
isEasyOpen :: TileSpeedup -> Id TileKind -> Bool Source #
Whether a tile kind (specified by its id) has an OpenTo feature and reasonable alter min skill.
alterMinSkill :: TileSpeedup -> Id TileKind -> Int Source #
alterMinWalk :: TileSpeedup -> Id TileKind -> Int Source #
isEasyOpenKind :: TileKind -> Bool Source #
isOpenable :: Ops TileKind -> Id TileKind -> Bool Source #
Whether a tile kind (specified by its id) has an OpenTo feature.
isClosable :: Ops TileKind -> Id TileKind -> Bool Source #
Whether a tile kind (specified by its id) has a CloseTo feature.