fish_lib/game/systems/weather_system/
config.rs1use crate::data::location_data::LocationData;
2use std::sync::Arc;
3
4#[derive(Debug)]
5pub struct WeatherSystemConfig {
6 pub cloud_brightness_light_block_factor: f32,
7 pub location_data: Arc<LocationData>,
8}
9
10impl Default for WeatherSystemConfig {
11 fn default() -> Self {
12 Self {
13 cloud_brightness_light_block_factor: 0.7,
14 location_data: Arc::new(LocationData::default()),
15 }
16 }
17}
18
19impl WeatherSystemConfig {
20 pub fn builder() -> WeatherSystemConfigBuilder {
21 WeatherSystemConfigBuilder::default()
22 }
23}
24
25#[derive(Debug, Default)]
26pub struct WeatherSystemConfigBuilder {
27 config: WeatherSystemConfig,
28}
29
30impl WeatherSystemConfigBuilder {
31 pub fn with_cloud_brightness_light_block_factor(mut self, value: f32) -> Self {
32 self.config.cloud_brightness_light_block_factor = value;
33 self
34 }
35
36 pub fn with_location_data(mut self, value: Arc<LocationData>) -> Self {
37 self.config.location_data = value;
38 self
39 }
40
41 pub fn build(self) -> WeatherSystemConfig {
42 self.config
43 }
44}