NDEVR
API Documentation
RandomMessageGenerator

Stores a collection of translated messages and provides random selection from them. More...

Public Member Functions

void addAll (const RandomMessageGenerator &messages)
 Appends all messages from another RandomMessageGenerator into this one.
void addMessage (const TranslatedString &message)
 Adds a single translated message to the collection.
TranslatedString randomMessage () const
 Selects and returns a random message from the stored collection.

Static Public Member Functions

static RandomMessageGeneratorDefault ()
 Returns the singleton default RandomMessageGenerator instance.

Detailed Description

Stores a collection of translated messages and provides random selection from them.

Used to display randomized tips, hints, or splash-screen messages to the user. A singleton instance is available via Default().

Definition at line 13 of file RandomMessageGenerator.h.

Member Function Documentation

◆ addAll()

void RandomMessageGenerator::addAll ( const RandomMessageGenerator & messages)

Appends all messages from another RandomMessageGenerator into this one.

Parameters
[in]messagesThe generator whose messages will be copied into this instance.

◆ addMessage()

void RandomMessageGenerator::addMessage ( const TranslatedString & message)

Adds a single translated message to the collection.

Parameters
[in]messageThe translated message to add.

◆ Default()

RandomMessageGenerator & RandomMessageGenerator::Default ( )
static

Returns the singleton default RandomMessageGenerator instance.

Returns
A reference to the shared default generator.

◆ randomMessage()

TranslatedString RandomMessageGenerator::randomMessage ( ) const

Selects and returns a random message from the stored collection.

Returns
A randomly chosen TranslatedString from the internal buffer.

The documentation for this class was generated from the following file: