14 #ifndef TOD_MANAGER_HPP_INCLUDED
15 #define TOD_MANAGER_HPP_INCLUDED
21 #include <boost/optional.hpp>
66 int for_turn = 0)
const;
76 int for_turn = 0)
const;
145 assert(index < static_cast<int>(
areas_.size()));
160 void set_turn(
const int num,
game_data* vars =
nullptr,
const bool increase_limit_if_needed =
true);
199 const int number_of_times,
200 const int for_turn_number,
201 const int current_time,
202 const bool only_to_allowed_range =
false)
const;
void set_new_current_times(const int new_current_turn_number)
For a change of the current turn number, sets the current times of the main time and all time areas...
void replace_local_schedule(const std::vector< time_of_day > &schedule, int area_index)
tod_manager & operator=(const tod_manager &manager)
bool has_turn_event_fired_
void replace_schedule(const config &time_cfg)
Replace the time of day schedule.
void set_turn(const int num, game_data *vars=nullptr, const bool increase_limit_if_needed=true)
Dynamically change the current turn number.
const time_of_day & get_time_of_day(int for_turn=0) const
Returns global time of day for the passed turn.
int get_current_area_time(int index) const
void set_area_id(int area_index, const std::string &id)
bool has_tod_bonus_changed_
void modify_turns_by_wml(const std::string &mod)
std::set< map_location > hexes
Definitions for the interface to Wesnoth Markup Language (WML).
Variant for storing WML attributes.
bool has_time_area() const
void modify_turns(const std::string &mod)
const time_of_day & get_previous_time_of_day() const
Object which defines a time of day with associated bonuses, image, sounds etc.
void set_current_time(int time)
void set_number_of_turns_by_wml(int num)
std::vector< time_of_day > times
config::attribute_value random_tod_
void update_server_information() const
void remove_time_area(const std::string &id)
Removes a time area from config, making it follow the scenario's normal time-of-day sequence...
std::vector< time_of_day > times_
Encapsulates the map of the game.
tod_manager(const config &scenario_cfg=config())
static const map_location & null_location()
bool is_time_left()
Function to check the end of turns.
void set_turn_by_wml(const int num, game_data *vars=nullptr, const bool increase_limit_if_needed=true)
Dynamically change the current turn number.
Encapsulates the map of the game.
const std::vector< time_of_day > & times(int index) const
bool has_tod_bonus_changed()
std::vector< std::string > get_area_ids() const
void set_number_of_turns(int num)
bool has_turn_event_fired()
const time_of_day & get_time_of_day_turn(const std::vector< time_of_day > ×, int nturn, const int current_time) const
Returns time of day object in the turn "nturn".
this class does not give synced random results derived classes might do.
const std::set< map_location > & get_area_by_index(int index) const
GLdouble GLdouble GLdouble r
static bool is_start_ToD(const std::string &)
const std::set< map_location > & get_area_by_id(const std::string &id) const
const time_of_day get_illuminated_time_of_day(const unit_map &units, const gamemap &map, const map_location &loc, int for_turn=0) const
Returns time of day object for the passed turn at a location.
int calculate_current_time(const int number_of_times, const int for_turn_number, const int current_time, const bool only_to_allowed_range=false) const
Computes for the main time or a time area the index of its times where we're currently at...
int get_current_time(const map_location &loc=map_location::null_location()) const
void replace_area_locations(int index, const std::set< map_location > &locs)
void add_time_area(const gamemap &map, const config &cfg)
Adds a new local time area from config, making it follow its own time-of-day sequence.
const std::vector< time_of_day > & times(const map_location &loc=map_location::null_location()) const
Container associating units to locations.
std::vector< area_time_of_day > areas_
void resolve_random(random_new::rng &r)
handles random_start_time, should be called before the game starts.
bool next_turn(game_data *vars)
Function to move to the next turn.
A config object defines a single node in a WML file, with access to child nodes.
GLsizei const GLcharARB ** string
int number_of_turns() const