use super::world::{known_cargo_slot_definition, runtime_cargo_class_name};
use crate::inspect::smp::catalog::conditions::{
    RealOrdinaryConditionKind, RealOrdinaryConditionMetadata, RealOrdinaryConditionMetric,
    RealWorldConditionKind, real_ordinary_condition_metadata,
};
use crate::inspect::smp::catalog::descriptors::{
    RealGroupedEffectDescriptorMetadata, RealGroupedEffectRuntimeStatus,
    real_grouped_effect_runtime_status_name,
};
use crate::inspect::smp::catalog::offsets::events::{
    EVENT_RUNTIME_COLLECTION_CLOSE_TAG, EVENT_RUNTIME_COLLECTION_METADATA_TAG,
    EVENT_RUNTIME_COLLECTION_PACKED_STATE_VERSION, EVENT_RUNTIME_COLLECTION_RECORDS_TAG,
    PACKED_EVENT_NONDIRECT_CONDITION_ROW_SERIALIZED_LEN,
    PACKED_EVENT_NONDIRECT_GROUPED_EFFECT_ROW_SERIALIZED_LEN,
    PACKED_EVENT_NONDIRECT_OPTIONAL_NAME_BLOCK_LEN, PACKED_EVENT_REAL_COMPACT_CONTROL_LEN,
    PACKED_EVENT_REAL_CONDITION_MARKER, PACKED_EVENT_REAL_CONDITION_ROW_LEN,
    PACKED_EVENT_REAL_GROUP_COUNT, PACKED_EVENT_REAL_GROUPED_EFFECT_MARKER,
    PACKED_EVENT_REAL_GROUPED_EFFECT_ROW_LEN, PACKED_EVENT_REAL_RECORD_TERMINATOR_MARKER,
    PACKED_EVENT_RECORD_SYNTHETIC_MAGIC, PACKED_EVENT_RECORD_TEMPLATE_SYNTHETIC_MAGIC,
    PACKED_EVENT_RECORDS_SYNTHETIC_MAGIC, PACKED_EVENT_TEXT_BAND_LABELS,
};
use crate::inspect::smp::common::{
    ascii_preview, compact_nondirect_signature_family, find_u16_le_offsets, find_u32_le_offsets,
    format_u16_word_signature, read_ascii_c_string_at, read_i32_at, read_i64_at, read_u8_at,
    read_u16_at, read_u16_window, read_u32_at,
};

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub(super) enum RealGroupedTargetSubject {
    Company,
    Player,
    Chairman,
    Territory,
    WholeGame,
}

mod actions;
mod collection;
mod compat;
mod conditions;
mod descriptors;
mod model;
mod nondirect;
mod real_records;
mod synthetic;

pub(super) use actions::*;
pub(super) use collection::live_ids::decode_live_entry_ids_from_tombstone_bitset;
#[cfg(test)]
pub(super) use collection::records::build_unsupported_event_runtime_record_summaries;
pub(super) use collection::summary::parse_event_runtime_collection_summary;
pub(super) use compat::*;
pub(super) use conditions::*;
pub(super) use descriptors::cargo::{
    grounded_named_cargo_production_label, recovered_cargo_production_slot,
    recovered_cargo_production_slot_from_condition_name,
};
pub(super) use descriptors::classification::{
    build_real_grouped_effect_semantic_preview, classify_real_grouped_effect_row_shape,
    classify_real_grouped_effect_semantic_family,
};
pub(super) use descriptors::locomotives::{
    recovered_locomotive_availability_loco_id, recovered_locomotive_cost_loco_id,
};
pub(super) use descriptors::metadata::real_grouped_effect_descriptor_metadata;
pub(super) use descriptors::runtime_keys::{
    real_grouped_company_governance_metric, runtime_candidate_availability_name,
    runtime_world_flag_key, runtime_world_scalar_key,
};
pub(super) use descriptors::targets::{
    derive_real_grouped_target_scope_name, derive_real_grouped_target_subject,
    real_grouped_target_subject_name,
};
pub(super) use nondirect::*;
pub(super) use real_records::*;
pub(super) use synthetic::*;

pub(crate) use descriptors::cargo::grounded_named_cargo_price_label;
pub(crate) use descriptors::runtime_keys::runtime_world_scalar_key_from_label;
pub use model::*;
