16#define GETTEXT_DOMAIN "wesnoth-lib"
29 : text(
cfg[
"text"].t_str())
30 , source(
cfg[
"source"].t_str())
35namespace tip_of_the_day
40 return { range.begin(), range.end() };
43std::vector<game_tip>
shuffle(
const std::vector<game_tip>& tips)
45 std::vector<game_tip> result = tips;
53 if(must_have_seen.empty()) {
58 return std::none_of(must_have_seen.begin(), must_have_seen.end(),
59 [&units](
const std::string& u) { return utils::contains(units, u); });
A config object defines a single node in a WML file, with access to child nodes.
child_itors child_range(std::string_view key)
std::set< std::string > & encountered_units()
static rng & default_instance()
Definitions for the interface to Wesnoth Markup Language (WML).
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.
void erase_if(Container &container, const Predicate &predicate)
Convenience wrapper for using std::remove_if on a container.
game_tip(const config &cfg)
std::vector< std::string > unit_filter
List of units to filter the tip upon.