1use crate::infrastructure::stats::InfrastructureStats;
5use crate::world::config::WorldConfig;
6use serde::{Deserialize, Serialize};
7use std::sync::Arc;
8
9#[derive(Clone, Debug, Deserialize, Serialize)]
10#[serde(rename_all = "camelCase")]
11pub struct WorldStats {
12 pub(super) infrastructure: Arc<InfrastructureStats>,
13}
14
15impl WorldStats {
16 pub fn new(config: &WorldConfig) -> Self {
17 Self {
18 infrastructure: Arc::new(InfrastructureStats::new(config)),
19 }
20 }
21
22 #[inline]
23 pub fn infrastructure(&self) -> Arc<InfrastructureStats> {
24 Arc::clone(&self.infrastructure)
25 }
26}