use std::path::PathBuf;

#[derive(Debug, Clone, PartialEq, Eq)]
pub(crate) enum Command {
    Validate { repo_root: PathBuf },
    Finance(FinanceCommand),
    Runtime(RuntimeCommand),
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub(crate) enum FinanceCommand {
    Eval {
        snapshot_path: PathBuf,
    },
    Diff {
        left_path: PathBuf,
        right_path: PathBuf,
    },
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub(crate) enum RuntimeCommand {
    FixtureState(FixtureStateCommand),
    Inspect(InspectCommand),
    Compare(CompareCommand),
    Scan(ScanCommand),
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub(crate) enum FixtureStateCommand {
    ValidateFixture {
        fixture_path: PathBuf,
    },
    SummarizeFixture {
        fixture_path: PathBuf,
    },
    ExportFixtureState {
        fixture_path: PathBuf,
        output_path: PathBuf,
    },
    DiffState {
        left_path: PathBuf,
        right_path: PathBuf,
    },
    SummarizeState {
        snapshot_path: PathBuf,
    },
    SnapshotState {
        input_path: PathBuf,
        output_path: PathBuf,
    },
    SummarizeSaveLoad {
        smp_path: PathBuf,
    },
    LoadSaveSlice {
        smp_path: PathBuf,
    },
    SnapshotSaveState {
        smp_path: PathBuf,
        output_path: PathBuf,
    },
    ExportSaveSlice {
        smp_path: PathBuf,
        output_path: PathBuf,
    },
    ExportOverlayImport {
        snapshot_path: PathBuf,
        save_slice_path: PathBuf,
        output_path: PathBuf,
    },
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub(crate) enum InspectCommand {
    InspectSmp {
        smp_path: PathBuf,
    },
    InspectCandidateTable {
        smp_path: PathBuf,
    },
    InspectCompactEventDispatchCluster {
        root_path: PathBuf,
    },
    InspectCompactEventDispatchClusterCounts {
        root_path: PathBuf,
    },
    InspectMapTitleHints {
        root_path: PathBuf,
    },
    InspectSaveCompanyChairman {
        smp_path: PathBuf,
    },
    InspectSavePlacedStructureTriplets {
        smp_path: PathBuf,
    },
    InspectPeriodicCompanyServiceTrace {
        smp_path: PathBuf,
    },
    InspectRegionServiceTrace {
        smp_path: PathBuf,
    },
    InspectInfrastructureAssetTrace {
        smp_path: PathBuf,
    },
    InspectSaveRegionQueuedNoticeRecords {
        smp_path: PathBuf,
    },
    InspectPlacedStructureDynamicSideBuffer {
        smp_path: PathBuf,
    },
    InspectUnclassifiedSaveCollections {
        smp_path: PathBuf,
    },
    InspectPk4 {
        pk4_path: PathBuf,
    },
    InspectCargoTypes {
        cargo_types_dir: PathBuf,
    },
    InspectBuildingTypeSources {
        building_types_dir: PathBuf,
        bindings_path: Option<PathBuf>,
    },
    InspectCargoSkins {
        cargo_skin_pk4_path: PathBuf,
    },
    InspectCargoEconomySources {
        cargo_types_dir: PathBuf,
        cargo_skin_pk4_path: PathBuf,
    },
    InspectCargoProductionSelector {
        cargo_types_dir: PathBuf,
        cargo_skin_pk4_path: PathBuf,
    },
    InspectCargoPriceSelector {
        cargo_types_dir: PathBuf,
        cargo_skin_pk4_path: PathBuf,
    },
    InspectWin {
        win_path: PathBuf,
    },
    ExtractPk4Entry {
        pk4_path: PathBuf,
        entry_name: String,
        output_path: PathBuf,
    },
    InspectCampaignExe {
        exe_path: PathBuf,
    },
    ExportProfileBlock {
        smp_path: PathBuf,
        output_path: PathBuf,
    },
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub(crate) enum CompareCommand {
    CompareRegionFixedRowRuns {
        left_path: PathBuf,
        right_path: PathBuf,
    },
    CompareClassicProfile {
        smp_paths: Vec<PathBuf>,
    },
    CompareRt3105Profile {
        smp_paths: Vec<PathBuf>,
    },
    CompareCandidateTable {
        smp_paths: Vec<PathBuf>,
    },
    CompareRecipeBookLines {
        smp_paths: Vec<PathBuf>,
    },
    CompareSetupPayloadCore {
        smp_paths: Vec<PathBuf>,
    },
    CompareSetupLaunchPayload {
        smp_paths: Vec<PathBuf>,
    },
    ComparePostSpecialConditionsScalars {
        smp_paths: Vec<PathBuf>,
    },
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub(crate) enum ScanCommand {
    ScanCandidateTableHeaders { root_path: PathBuf },
    ScanCandidateTableNamedRuns { root_path: PathBuf },
    ScanSpecialConditions { root_path: PathBuf },
    ScanAlignedRuntimeRuleBand { root_path: PathBuf },
    ScanPostSpecialConditionsScalars { root_path: PathBuf },
    ScanPostSpecialConditionsTail { root_path: PathBuf },
    ScanRecipeBookLines { root_path: PathBuf },
}
