void tod_manager::add_time_area(const std::string& id, const std::set<map_location>& locs, const config& time_cfg) { areas_.push_back(area_time_of_day()); area_time_of_day& area = areas_.back(); area.id = id; area.hexes = locs; time_of_day::parse_times(time_cfg, area.times); }
void tod_manager::add_time_area(const std::string& id, const std::set<map_location>& locs, const config& time_cfg) { areas_.push_back(area_time_of_day()); area_time_of_day& area = areas_.back(); area.id = id; area.hexes = locs; area.currentTime = time_cfg["current_time"].to_int(0); time_of_day::parse_times(time_cfg, area.times); has_tod_bonus_changed_ = true; }
void tod_manager::add_time_area(const config& cfg) { areas_.push_back(area_time_of_day()); area_time_of_day &area = areas_.back(); area.id = cfg["id"]; area.xsrc = cfg["x"]; area.ysrc = cfg["y"]; std::vector<map_location> const& locs = parse_location_range(area.xsrc, area.ysrc); std::copy(locs.begin(), locs.end(), std::inserter(area.hexes, area.hexes.end())); time_of_day::parse_times(cfg, area.times); }
void tod_manager::add_time_area(const gamemap & map, const config& cfg) { areas_.push_back(area_time_of_day()); area_time_of_day &area = areas_.back(); area.id = cfg["id"].str(); area.xsrc = cfg["x"].str(); area.ysrc = cfg["y"].str(); area.currentTime = cfg["current_time"].to_int(0); std::vector<map_location> const& locs (map.parse_location_range(area.xsrc, area.ysrc, true)); area.hexes.insert(locs.begin(), locs.end()); time_of_day::parse_times(cfg, area.times); has_tod_bonus_changed_ = true; }