LambdaHack-0.7.0.0: A game engine library for roguelike dungeon crawlers

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Client.UI.Msg

Contents

Description

Game messages displayed on top of the screen for the player to read and then saved to player history.

Synopsis

Msg

data Msg Source #

The type of a single game message.

Instances

Eq Msg Source # 

Methods

(==) :: Msg -> Msg -> Bool #

(/=) :: Msg -> Msg -> Bool #

Show Msg Source # 

Methods

showsPrec :: Int -> Msg -> ShowS #

show :: Msg -> String #

showList :: [Msg] -> ShowS #

Generic Msg Source # 

Associated Types

type Rep Msg :: * -> * #

Methods

from :: Msg -> Rep Msg x #

to :: Rep Msg x -> Msg #

Binary Msg Source # 

Methods

put :: Msg -> Put #

get :: Get Msg #

putList :: [Msg] -> Put #

type Rep Msg Source # 
type Rep Msg = D1 * (MetaData "Msg" "Game.LambdaHack.Client.UI.Msg" "LambdaHack-0.7.0.0-3XPyz9bw1i28qJIoWU6CaM" False) (C1 * (MetaCons "Msg" PrefixI True) ((:*:) * (S1 * (MetaSel (Just Symbol "msgLine") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 * AttrLine)) (S1 * (MetaSel (Just Symbol "msgHist") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 * Bool))))

Report

data RepMsgN Source #

Instances

Show RepMsgN Source # 
Generic RepMsgN Source # 

Associated Types

type Rep RepMsgN :: * -> * #

Methods

from :: RepMsgN -> Rep RepMsgN x #

to :: Rep RepMsgN x -> RepMsgN #

Binary RepMsgN Source # 

Methods

put :: RepMsgN -> Put #

get :: Get RepMsgN #

putList :: [RepMsgN] -> Put #

type Rep RepMsgN Source # 
type Rep RepMsgN = D1 * (MetaData "RepMsgN" "Game.LambdaHack.Client.UI.Msg" "LambdaHack-0.7.0.0-3XPyz9bw1i28qJIoWU6CaM" False) (C1 * (MetaCons "RepMsgN" PrefixI True) ((:*:) * (S1 * (MetaSel (Just Symbol "repMsg") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 * Msg)) (S1 * (MetaSel (Just Symbol "_repN") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 * Int))))

data Report Source #

The set of messages, with repetitions, to show at the screen at once.

Instances

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.

renderReport :: Report -> AttrLine Source #

Render a report as a (possibly very long) AttrLine.

History

data History Source #

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.

renderHistory :: History -> [AttrLine] Source #

Render history as many lines of text, wrapping if necessary.

Internal operations