Safe Haskell | None |
---|---|
Language | Haskell2010 |
Game messages displayed on top of the screen for the player to read.
- data Msg
- toMsg :: AttrLine -> Msg
- toPrompt :: AttrLine -> Msg
- data RepMsgN
- data Report
- emptyReport :: Report
- nullReport :: Report -> Bool
- singletonReport :: Msg -> Report
- snocReport :: Report -> Msg -> Report
- consReportNoScrub :: Msg -> Report -> Report
- renderReport :: Report -> AttrLine
- findInReport :: (AttrLine -> Bool) -> Report -> Maybe Msg
- incrementInReport :: (AttrLine -> Bool) -> Report -> Maybe Report
- lastMsgOfReport :: Report -> (AttrLine, Report)
- data History
- emptyHistory :: Int -> History
- addReport :: History -> Time -> Report -> History
- lengthHistory :: History -> Int
- lastReportOfHistory :: History -> Report
- replaceLastReportOfHistory :: Report -> History -> History
- splitReportForHistory :: X -> AttrLine -> [AttrLine]
- renderHistory :: History -> [AttrLine]
Msg
The type of a single game message.
Report
The set of messages, with repetitions, to show at the screen at once.
emptyReport :: Report Source #
Empty set of messages.
nullReport :: Report -> Bool Source #
Test if the set of messages is empty.
singletonReport :: Msg -> Report Source #
Construct a singleton set of messages.
snocReport :: Report -> Msg -> Report Source #
Add a message to the end of report. Deletes old prompt messages.
consReportNoScrub :: Msg -> Report -> Report Source #
Add a message to the end of report. Does not delete old prompt messages nor handle repetitions.
History
The history of reports. This is a ring buffer of the given length
emptyHistory :: Int -> History Source #
Empty history of reports of the given maximal length.
addReport :: History -> Time -> Report -> History Source #
Add a report to history, handling repetitions.
lengthHistory :: History -> Int Source #
lastReportOfHistory :: History -> Report Source #
renderHistory :: History -> [AttrLine] Source #
Render history as many lines of text, wrapping if necessary.