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")]
11#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
12pub struct WorldStats {
13 pub(super) infrastructure: Arc<InfrastructureStats>,
14}
15
16impl WorldStats {
17 pub fn new(config: &WorldConfig) -> Self {
18 Self {
19 infrastructure: Arc::new(InfrastructureStats::new(config)),
20 }
21 }
22
23 #[inline]
24 pub fn infrastructure(&self) -> Arc<InfrastructureStats> {
25 Arc::clone(&self.infrastructure)
26 }
27}