use sylpheed_formats::{game_data, PakArchive};
fn main(){
    let disc=std::env::var("SYLPHEED_DISC").unwrap();
    let pak=PakArchive::open(format!("{disc}/dat/GP_MAIN_GAME_E.pak")).unwrap();
    let sq=game_data::load_squadrons(&pak);
    println!("{} squadron definitions", sq.len());
    for s in sq.iter().filter(|s|s.side.as_deref()==Some("TCAF")).take(6){
        let mem:Vec<String>=s.members.iter().map(|m|m.trim_start_matches("UN_").chars().take(18).collect()).collect();
        println!("  {:8} {:22} {:24} x{}  {:?}", s.id.clone().unwrap_or("?".into()), s.formation_id.clone().unwrap_or_default(), s.ai_id.clone().unwrap_or_default(), s.count.unwrap_or(0), mem);
    }
}
