mod base;
mod collections;
mod packed_events;
mod selected_company;
mod world;

use crate::state::RuntimeState;
use crate::summary::RuntimeSummary;

use base::build_base_runtime_summary;
use collections::{apply_collections_summary_fields, build_collections_summary_fields};
use packed_events::{apply_packed_event_summary_fields, build_packed_event_summary_fields};
use selected_company::{
    apply_selected_company_summary_fields, build_selected_company_summary_fields,
};
use world::{apply_world_summary_fields, build_world_summary_fields};

pub(in crate::summary) fn build_runtime_summary(state: &RuntimeState) -> RuntimeSummary {
    let mut summary = build_base_runtime_summary(state.calendar);
    apply_world_summary_fields(&mut summary, build_world_summary_fields(state));
    apply_selected_company_summary_fields(
        &mut summary,
        build_selected_company_summary_fields(state),
    );
    apply_collections_summary_fields(&mut summary, build_collections_summary_fields(state));
    apply_packed_event_summary_fields(&mut summary, build_packed_event_summary_fields(state));
    summary
}
