The Battle for Wesnoth  1.15.2+dev
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
time_of_day Struct Reference

Object which defines a time of day with associated bonuses, image, sounds etc. More...

#include <time_of_day.hpp>

Public Member Functions

 time_of_day ()
 A default-constructed time of day object shouldn't really be used so this only loads some null values. More...
 
 time_of_day (const config &cfg)
 Construct a time of day from config. More...
 
bool operator== (const time_of_day &o) const
 
void write (config &cfg) const
 

Static Public Member Functions

static void parse_times (const config &cfg, std::vector< time_of_day > &normal_times)
 Parse config and add time of day entries into passed vector. More...
 

Public Attributes

int lawful_bonus
 The % bonus lawful units receive. More...
 
int bonus_modified
 
std::string image
 The image to be displayed in the game status. More...
 
t_string name
 
t_string description
 
std::string id
 
std::string image_mask
 The image that is to be laid over all images while this time of day lasts. More...
 
tod_color color
 The color modifications that should be made to the game board to reflect the time of day. More...
 
std::string sounds
 List of "ambient" sounds associated with this time_of_day, Played at the beginning of turn. More...
 

Detailed Description

Object which defines a time of day with associated bonuses, image, sounds etc.

Definition at line 57 of file time_of_day.hpp.

Constructor & Destructor Documentation

◆ time_of_day() [1/2]

time_of_day::time_of_day ( )

A default-constructed time of day object shouldn't really be used so this only loads some null values.

Ideally, there should be getters for properties that would emit a warning when such an object is actually used, but it does not seem necessary at the moment.

Definition at line 41 of file time_of_day.cpp.

Referenced by parse_times().

◆ time_of_day() [2/2]

time_of_day::time_of_day ( const config cfg)
explicit

Construct a time of day from config.

Definition at line 29 of file time_of_day.cpp.

Member Function Documentation

◆ operator==()

bool time_of_day::operator== ( const time_of_day o) const
inline

Definition at line 70 of file time_of_day.hpp.

References bonus_modified, id, image, image_mask, lawful_bonus, name, sounds, and write().

◆ parse_times()

void time_of_day::parse_times ( const config cfg,
std::vector< time_of_day > &  normal_times 
)
static

Parse config and add time of day entries into passed vector.

Definition at line 70 of file time_of_day.cpp.

References config::child_range(), t, and time_of_day().

Referenced by tod_manager::add_time_area(), tod_manager::replace_schedule(), and tod_manager::tod_manager().

◆ write()

void time_of_day::write ( config cfg) const

Member Data Documentation

◆ bonus_modified

int time_of_day::bonus_modified

◆ color

tod_color time_of_day::color

The color modifications that should be made to the game board to reflect the time of day.

Definition at line 103 of file time_of_day.hpp.

Referenced by gui2::dialogs::custom_tod::color_slider_callback(), display::draw_hex(), game_lua_kernel::intf_get_time_of_day(), unit_box_at(), gui2::dialogs::custom_tod::update_selected_tod_info(), display::update_tod(), and write().

◆ description

t_string time_of_day::description

Definition at line 90 of file time_of_day.hpp.

Referenced by write().

◆ id

std::string time_of_day::id

◆ image

std::string time_of_day::image

◆ image_mask

std::string time_of_day::image_mask

The image that is to be laid over all images while this time of day lasts.

Definition at line 97 of file time_of_day.hpp.

Referenced by display::draw_hex(), game_display::new_turn(), operator==(), gui2::dialogs::tod_getter_mask(), gui2::dialogs::custom_tod::update_selected_tod_info(), and write().

◆ lawful_bonus

int time_of_day::lawful_bonus

◆ name

t_string time_of_day::name

◆ sounds

std::string time_of_day::sounds

List of "ambient" sounds associated with this time_of_day, Played at the beginning of turn.

Definition at line 109 of file time_of_day.hpp.

Referenced by play_controller::init_side_end(), operator==(), gui2::dialogs::tod_getter_sound(), gui2::dialogs::custom_tod::update_selected_tod_info(), and write().


The documentation for this struct was generated from the following files: