#![feature(generic_const_exprs)]
#![feature(let_chains)]

use std::fs::File;
use std::path::{Path, PathBuf};
use anyhow::Context;
use crate::cli::cli::OutputFormat;
use crate::system::model::HistoryLine;
use crate::system::spaces::square_grid::Grid2D;
use clap::{Parser, Command, Args, Subcommand};
use serde::de::DeserializeOwned;
use serde::Deserialize;
use svg::Node;
use svg::node::element::Rectangle;
use crate::system::Position;
use crate::system::spaces::hexagonal::HexPosition;

mod system;
mod cli;
mod tools;

#[derive(Debug, Parser)]
enum ToolsCli {
    Render(RenderCli),
    BoxCount(BoxCountCli)
}

#[derive(Debug, Args)]
struct RenderCli {

}

#[derive(Debug, Args)]
struct BoxCountCli {
    #[arg(value_enum, short, long, default_value_t = OutputFormat::Positions)]
    format: OutputFormat,
    path: PathBuf,
}

fn main() {
    let args = ToolsCli::parse();
    dbg!(&args);

    match args {
        ToolsCli::Render(_) => {}
        ToolsCli::BoxCount(cli) => tools::boxcount::main(&cli),
    }
}
