////// Funnels. weather_sum sum_conditions( const calendar &startturn, const calendar &endturn, const tripoint &location ) { int tick_size = MINUTES(1); weather_sum data; for( calendar turn(startturn); turn < endturn; turn += tick_size ) { const int diff = endturn - startturn; if( diff <= 0 ) { return data; } else if( diff < 10 ) { tick_size = 1; } else if( diff > DAYS(7) ) { tick_size = HOURS(1); } else { tick_size = MINUTES(1); } const auto wtype = g->weather_gen->get_weather_conditions( point( location.x, location.y ), turn ); proc_weather_sum( wtype, data, turn, tick_size ); } return data; }
////// Funnels. weather_sum sum_conditions( const time_point &start, const time_point &end, const tripoint &location ) { time_duration tick_size = 0_turns; weather_sum data; const auto wgen = g->get_cur_weather_gen(); for( time_point t = start; t < end; t += tick_size ) { const time_duration diff = end - t; if( diff < 10_turns ) { tick_size = 1_turns; } else if( diff > 7_days ) { tick_size = 1_hours; } else { tick_size = 1_minutes; } weather_type wtype; if( g->weather_override == WEATHER_NULL ) { wtype = wgen.get_weather_conditions( location, t, g->get_seed() ); } else { wtype = g->weather_override; } proc_weather_sum( wtype, data, t, tick_size ); w_point w = wgen.get_weather( location, t, g->get_seed() ); data.wind_amount += get_local_windpower( g->windspeed, overmap_buffer.ter( location ), location, g->winddirection, false ) * to_turns<int>( tick_size ); } return data; }
////// Funnels. weather_sum sum_conditions( const time_point &start, const time_point &end, const tripoint &location ) { time_duration tick_size = 0; weather_sum data; const auto wgen = g->get_cur_weather_gen(); for( time_point t = start; t < end; t += tick_size ) { const time_duration diff = end - t; if( diff < 10_turns ) { tick_size = 1_turns; } else if( diff > 7_days ) { tick_size = 1_hours; } else { tick_size = 1_minutes; } const auto wtype = wgen.get_weather_conditions( location, to_turn<int>( t ), g->get_seed() ); proc_weather_sum( wtype, data, t, tick_size ); } return data; }