' ==============================================================================
' 模块名称: cProcessor_CloneNew
' 模块类别: 类模块
' 模块职责: 通用克隆新增策略。
' 逻辑描述: 遍历传入的 targetBOMs 母版集合，每遇到一个就克隆一行追加到总库，并赋新值。
' ==============================================================================
Option Explicit
Implements IModuleProcessor

Private Sub IModuleProcessor_ProcessSpec( _
    ByRef allBOMs As Collection, _
    ByRef targetBOMs As Collection, _
    ByVal paramName As String, _
    ByVal newValue As String, _
    ByRef engine As cConditionEngine)

    Dim rowObj As cBOMRow
    Dim newRow As cBOMRow

    ' 为 targetBOMs 里的每一个母版克隆出一个新对象
    For Each rowObj In targetBOMs
        ' 调用数据访问层的克隆方法，自动加入 allBOMs 总集合
        Set newRow = mBOMRepository.InsertNewBOMRow(allBOMs, rowObj)

        ' 新行的选择条件直接赋予纯粹的新规格 (例如：lcfw=M19)
        newRow.Condition = paramName & "=" & newValue
    Next rowObj

End Sub