use super::super::types::OverlayDesc;
use tool_helper::{Error, Output};

pub fn write(output: &mut Output, overlay_desc: &OverlayDesc) -> Result<(), Error> {
    if !overlay_desc.is_empty() {
        write!(output, "OVERLAYSECTION = ")?;

        for slot in overlay_desc {
            for section in &slot.sections {
                write!(output, ".{} ", section.name)?;
            }
        }
        
        writeln!(output, "")?;
    }

    Ok(())
}