--
-- CustomLicensePlate
--
-- @author LucasPlayzTV
-- @date 22/11/2021
-- @version 1.0
--

LicensePlateManager.MOD_NAME = g_currentModName;
LicensePlateManager.MOD_DIRECTORY = g_currentModDirectory;

function LicensePlateManager:loadMapData(xmlFile, missionInfo, baseDirectory)
    LicensePlateManager:superClass().loadMapData(self);
    self.baseDirectory = baseDirectory;
    
    LicensePlateManager.createLicensePlateXMLSchema();
    
    local filename = getXMLString(xmlFile, "licensePlates#filename");
    local licenseFilename = self.MOD_DIRECTORY .. "licensePlatesDE.xml";
    self.licensePlateXML = XMLFile.load("mapLicensePlates", licenseFilename, LicensePlateManager.xmlSchema);
    if self.licensePlateXML ~= nil then
        self.xmlReferences = 0;
        self:loadLicensePlatesFromXML(self.licensePlateXML, baseDirectory);
        
        if self.licensePlateXML ~= nil and self.xmlReferences == 0 then
            self.licensePlateXML:delete();
            self.licensePlateXML = nil;
        end;
    end;
end;