//
//  MVMCoreUIViewControllerMappingObject+Extension.swift
//  MVMCoreUI
//
//  Created by Scott Pfeil on 4/21/20.
//  Copyright © 2020 Verizon Wireless. All rights reserved.
//

import Foundation

public extension MVMCoreUIViewControllerMappingObject {
    func register<T: TemplateProtocol>(template: T.Type) {
        add(toTemplateViewControllerMapping: [template.TemplateModel.identifier: MVMCoreViewControllerProgrammaticMappingObject(with: template)!])
    }
    
    @objc func registerTemplates() {
        register(template: MoleculeStackTemplate.self)
        add(toTemplateViewControllerMapping: [StackCenteredPageTemplateModel.identifier: MVMCoreViewControllerProgrammaticMappingObject(with: MoleculeStackCenteredTemplate.self)!])
        add(toTemplateViewControllerMapping: ["modalStack": MVMCoreViewControllerProgrammaticMappingObject(with: ModalMoleculeStackTemplate.self)!])

        register(template: MoleculeListTemplate.self)
        add(toTemplateViewControllerMapping: ["modalList": MVMCoreViewControllerProgrammaticMappingObject(with: ModalMoleculeListTemplate.self)!])
        add(toTemplateViewControllerMapping: [SectionListTemplateModel.identifier: MVMCoreViewControllerProgrammaticMappingObject(with: SectionListTemplate.self)!])
        add(toTemplateViewControllerMapping: [ModalSectionListTemplateModel.identifier: MVMCoreViewControllerProgrammaticMappingObject(with: ModalSectionListTemplate.self)!])

        register(template: ThreeLayerTemplate.self)
        register(template: ThreeLayerCenterTemplate.self)
        register(template: ThreeLayerFillMiddleTemplate.self)

        register(template: CollectionTemplate.self)
    }
}
