The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Functions
gui2::tips Namespace Reference

Functions

std::vector< ttipload (const config &cfg)
 Loads the tips from a config. More...
 
std::vector< ttipshuffle (const std::vector< ttip > &tips)
 Shuffles the tips. More...
 

Function Documentation

std::vector< ttip > gui2::tips::load ( const config cfg)

Loads the tips from a config.

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

Definition at line 36 of file tips.cpp.

References config::child_range(), and gui2::tip::tip().

Referenced by gui2::tgui_definition::read().

std::vector< ttip > gui2::tips::shuffle ( const std::vector< ttip > &  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 49 of file tips.cpp.

References preferences::encountered_units(), gui2::tip::tip(), gui2::ttip::unit_filter_, and resources::units.

Referenced by choose_track(), gui2::settings::get_tips(), and editor::editor_action_shuffle_area::perform_without_undo().