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 #

The type of a single game message.

Instances
Eq Msg # 
Instance details

Defined in Game.LambdaHack.Client.UI.Msg

Methods

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

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

Show Msg # 
Instance details

Defined in Game.LambdaHack.Client.UI.Msg

Methods

showsPrec :: Int -> Msg -> ShowS #

show :: Msg -> String #

showList :: [Msg] -> ShowS #

Generic Msg # 
Instance details

Defined in Game.LambdaHack.Client.UI.Msg

Associated Types

type Rep Msg :: Type -> Type #

Methods

from :: Msg -> Rep Msg x #

to :: Rep Msg x -> Msg #

Binary Msg # 
Instance details

Defined in Game.LambdaHack.Client.UI.Msg

Methods

put :: Msg -> Put #

get :: Get Msg #

putList :: [Msg] -> Put #

type Rep Msg # 
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-1NVXOytHwux3AEZcvJHaGA" 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 #

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

Instances
Show Report # 
Instance details

Defined in Game.LambdaHack.Client.UI.Msg

Binary Report # 
Instance details

Defined in Game.LambdaHack.Client.UI.Msg

Methods

put :: Report -> Put #

get :: Get Report #

putList :: [Report] -> Put #

nullReport :: Report -> Bool #

Test if the set of messages is empty.

consReport :: Msg -> Report -> Report #

Add a message to the start of report.

renderReport :: Report -> AttrLine #

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

History

data History #

The history of reports. This is a ring buffer of the given length containing old archived history and two most recent reports stored separately.

Instances
Show History # 
Instance details

Defined in Game.LambdaHack.Client.UI.Msg

Generic History # 
Instance details

Defined in Game.LambdaHack.Client.UI.Msg

Associated Types

type Rep History :: Type -> Type #

Methods

from :: History -> Rep History x #

to :: Rep History x -> History #

Binary History # 
Instance details

Defined in Game.LambdaHack.Client.UI.Msg

Methods

put :: History -> Put #

get :: Get History #

putList :: [History] -> Put #

type Rep History # 
Instance details

Defined in Game.LambdaHack.Client.UI.Msg

emptyHistory :: Int -> History #

Empty history of the given maximal length.

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

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

archiveReport :: History -> Time -> History #

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

renderHistory :: History -> [AttrLine] #

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 #

Instances
Show RepMsgN # 
Instance details

Defined in Game.LambdaHack.Client.UI.Msg

Generic RepMsgN # 
Instance details

Defined in Game.LambdaHack.Client.UI.Msg

Associated Types

type Rep RepMsgN :: Type -> Type #

Methods

from :: RepMsgN -> Rep RepMsgN x #

to :: Rep RepMsgN x -> RepMsgN #

Binary RepMsgN # 
Instance details

Defined in Game.LambdaHack.Client.UI.Msg

Methods

put :: RepMsgN -> Put #

get :: Get RepMsgN #

putList :: [RepMsgN] -> Put #

type Rep RepMsgN # 
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-1NVXOytHwux3AEZcvJHaGA" 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 #

Empty set of messages.

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

Add a message to the end of the report.