LambdaHack-0.8.1.2: 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 #

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

Show Msg Source # 
Instance details

Defined in Game.LambdaHack.Client.UI.Msg

Methods

showsPrec :: Int -> Msg -> ShowS #

show :: Msg -> String #

showList :: [Msg] -> ShowS #

Generic Msg Source # 
Instance details

Defined in Game.LambdaHack.Client.UI.Msg

Associated Types

type Rep Msg :: * -> * #

Methods

from :: Msg -> Rep Msg x #

to :: Rep Msg x -> Msg #

Binary Msg Source # 
Instance details

Defined in Game.LambdaHack.Client.UI.Msg

Methods

put :: Msg -> Put #

get :: Get Msg #

putList :: [Msg] -> Put #

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.1.2-9Fmfvbfsr9xEInnejydwaW" 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

Methods

put :: Report -> Put #

get :: Get Report #

putList :: [Report] -> Put #

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.

Instances
Show History Source # 
Instance details

Defined in Game.LambdaHack.Client.UI.Msg

Generic History Source # 
Instance details

Defined in Game.LambdaHack.Client.UI.Msg

Associated Types

type Rep History :: * -> * #

Methods

from :: History -> Rep History x #

to :: Rep History x -> History #

Binary History Source # 
Instance details

Defined in Game.LambdaHack.Client.UI.Msg

Methods

put :: History -> Put #

get :: Get History #

putList :: [History] -> Put #

type Rep History Source # 
Instance details

Defined in Game.LambdaHack.Client.UI.Msg

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 :: * -> * #

Methods

from :: RepMsgN -> Rep RepMsgN x #

to :: Rep RepMsgN x -> RepMsgN #

Binary RepMsgN Source # 
Instance details

Defined in Game.LambdaHack.Client.UI.Msg

Methods

put :: RepMsgN -> Put #

get :: Get RepMsgN #

putList :: [RepMsgN] -> Put #

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.1.2-9Fmfvbfsr9xEInnejydwaW" 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.