public static TextureCleanupData FindFullOutputPath(this IList <TextureCleanupData> collection, string path) { path = CgbUtils.NormalizePath(path); var existing = (from x in collection where x.FullOutputPathNormalized == path select x).FirstOrDefault(); return(existing); }
/// <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); }
private void RebuildOutputToInputPathRecords() { _outputToInputPathsNormalized = new List <TextureCleanupData>(); foreach (var txp in _texturePaths) { var outPath = GetOutputPathForTexture(txp); var outPathNrm = CgbUtils.NormalizePath(outPath); var existing = _outputToInputPathsNormalized.FindFullOutputPath(outPathNrm); if (null == existing) { var inpPath = GetInputPathForTexture(txp); var inpPathNrm = CgbUtils.NormalizePath(inpPath); _outputToInputPathsNormalized.Add(new TextureCleanupData { FullOutputPathNormalized = outPathNrm, FullInputPathNormalized = inpPathNrm, OriginalRelativePath = txp }); } } }