/// <summary> /// Determines whether or not there is a conflict with a different asset. /// A conflict means: same output path, but different input paths /// </summary> /// <param name="other">The other deployment to compare with</param> /// <returns>true if there is a conflict, false if everything is fine</returns> public virtual bool HasConflictWith(DeploymentBase other) { if (CgbUtils.NormalizePath(this.DesignatedOutputPath) == CgbUtils.NormalizePath(other.DesignatedOutputPath)) { return(CgbUtils.NormalizePath(this._inputFile.FullName) != CgbUtils.NormalizePath(other._inputFile.FullName)); } return(false); }
/// <summary> /// Determines if this deployment has conflicts with an other deployment, /// i.e. same output paths, but different input paths. /// (If such a case is detected, the conflict should be solved before deployment) /// </summary> /// <param name="other">The other deployment to compare with</param> /// <returns>true if there is a conflict, false otherwise</returns> public override bool HasConflictWith(DeploymentBase other) { if (other is ModelDeployment otherModel) { System.Diagnostics.Debug.Assert(null != this._outputToInputPathsNormalized); // If that assert fails, SetTextures has not been invoked before System.Diagnostics.Debug.Assert(null != otherModel._outputToInputPathsNormalized); // If that assert fails, SetTextures has not been invoked before // Process in order, to (hopefully) maintain the original order. // The purpose of this shall be to have consistent behavior across multiple events. foreach (var pathRecord in _outputToInputPathsNormalized) { var existingInOther = otherModel._outputToInputPathsNormalized.FindFullOutputPath(pathRecord.FullOutputPathNormalized); if (null != existingInOther) { if (pathRecord.FullInputPathNormalized != existingInOther.FullInputPathNormalized) // found a conflict! Input paths do not match! { return(true); } } } } // In any case, perform the check of the base class: return(base.HasConflictWith(other)); }