pub struct Header {
    pub wad_id: String,
    pub num_lumps: u32,
    pub dir_offset: u32,
}

use crate::utils::{read_ascii, read_u32_le};

impl Header {
    pub fn read_data(data: &[u8]) -> Self {
        let id = read_ascii(&data[..4]).to_string();
        let lumps = read_u32_le(&data[4..8]);
        let offset = read_u32_le(&data[8..12]);

        Self {
            wad_id: id,
            num_lumps: lumps,
            dir_offset: offset,
        }
    }
}
