The Battle for Wesnoth 1.21.0-dev
 
Loading...
Searching...
No Matches
Functions
gui2::tip_of_the_day Namespace Reference

Functions

std::vector< game_tip > load (const config &cfg)
 Loads the tips from a config.
 
std::vector< game_tip > shuffle (const std::vector< game_tip > &tips)
 Shuffles the tips.
 

Function Documentation

◆ load()

std::vector< game_tip > gui2::tip_of_the_day::load ( const config &  cfg)

Loads the tips from a config.

Parameters
cfgA config with the tips.
Returns
The loaded tips.

Definition at line 37 of file tips.cpp.

References cfg, and config::child_range().

◆ shuffle()

std::vector< game_tip > gui2::tip_of_the_day::shuffle ( const std::vector< game_tip > &  tips)

Shuffles the tips.

This routine shuffles the tips and filters out the unwanted ones.

Parameters
tipsThe tips.
Returns
The filtered tips in random order.

Definition at line 43 of file tips.cpp.

References randomness::rng::default_instance(), prefs::encountered_units(), utils::erase_if(), prefs::get(), and gui2::game_tip::unit_filter.

Referenced by gui2::dialogs::title_screen::init_callbacks().