LambdaHack-0.8.3.0: A game engine library for tactical squad ASCII 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 # 
Instance details

Defined in Game.LambdaHack.Client.UI.Msg

Methods

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

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

Show Msg Source # 
Instance details

Defined in Game.LambdaHack.Client.UI.Msg

Generic Msg Source # 
Instance details

Defined in Game.LambdaHack.Client.UI.Msg

Associated Types

type Rep Msg :: Type -> Type Source #

Methods

from :: Msg -> Rep Msg x Source #

to :: Rep Msg x -> Msg Source #

Binary Msg Source # 
Instance details

Defined in Game.LambdaHack.Client.UI.Msg

Methods

put :: Msg -> Put Source #

get :: Get Msg Source #

putList :: [Msg] -> Put Source #

type Rep Msg Source # 
Instance details

Defined in Game.LambdaHack.Client.UI.Msg

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

Report

data Report Source #

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

Instances
Show Report Source # 
Instance details

Defined in Game.LambdaHack.Client.UI.Msg

Binary Report Source # 
Instance details

Defined in Game.LambdaHack.Client.UI.Msg

nullReport :: Report -> Bool Source #

Test if the set of messages is empty.

consReport :: Msg -> Report -> Report Source #

Add a message to the start of report.

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 containing old archived history and two most recent reports stored separately.

emptyHistory :: Int -> History Source #

Empty history of the given maximal length.

addToReport :: History -> Msg -> Int -> (History, Bool) Source #

Add a message to the new report of history, eliminating a possible duplicate and noting its existence in the result.

archiveReport :: History -> Time -> History Source #

Archive old report to history, filtering out prompts. Set up new report with a new timestamp.

renderHistory :: History -> [AttrLine] Source #

Render history as many lines of text. New report is not rendered. It's expected to be empty when history is shown.

Internal operations

data RepMsgN Source #

Instances
Show RepMsgN Source # 
Instance details

Defined in Game.LambdaHack.Client.UI.Msg

Generic RepMsgN Source # 
Instance details

Defined in Game.LambdaHack.Client.UI.Msg

Associated Types

type Rep RepMsgN :: Type -> Type Source #

Binary RepMsgN Source # 
Instance details

Defined in Game.LambdaHack.Client.UI.Msg

type Rep RepMsgN Source # 
Instance details

Defined in Game.LambdaHack.Client.UI.Msg

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

emptyReport :: Report Source #

Empty set of messages.

snocReport :: Report -> Msg -> Int -> Report Source #

Add a message to the end of the report.