print("[FA] initSpecialization loading...")

local function hasSowingMachineSpec(typeEntry)
    -- Direkte Spezialisierung prüfen
    if typeEntry.specializationsByName["sowingMachine"] then
        return true
    end

    return false
end

local function onValidateTypes(typeManager)
    if typeManager.typeName ~= "vehicle" then return end

    for typeName, typeEntry in pairs(g_vehicleTypeManager:getTypes()) do
        if hasSowingMachineSpec(typeEntry) then
            print("[FA] + attach to:", typeName)
            g_vehicleTypeManager:addSpecialization(typeName, "fahrgassenAutomatik")
        end
    end
end

TypeManager.validateTypes = Utils.prependedFunction(TypeManager.validateTypes, onValidateTypes)
