mod wadfile;

use wadfile::WADFile;

fn main() {
    let wad_file = WADFile::from_path("WADs/doom1.wad");

    println!(
        "WAD Path: {}
        
Header:
    Identifier: {}
    Lump Count: {}
    Initial Offset: {}
    Number of Found Lumps: {}",
        wad_file.wad_path,
        wad_file.identifier,
        wad_file.num_lumps,
        wad_file.init_offset,
        wad_file.get_directory_len()
    );

    println!("First 15 Directory Entries:");

    for i in 0..15 {
        println!(
            "\t{}\tName {}\tPosition {}\tSize {}",
            i,
            wad_file.get_lump_name(i),
            wad_file.get_lump_offset(i),
            wad_file.get_lump_size(i)
        );
    }

    println!(
        "Index of e1m1 is: {}",
        wad_file.get_index_from_name("e1m1").unwrap()
    );
}
