public void Do(params object[] args) { array = args as Album[]; if (array == null) { return; } counts = new int[array.Length]; var i = 0; NpkCoder.Compare(GamePath, (a1, a2) => { counts[i] = a1.List.Count - a2.List.Count; if (counts[i] > 0) { var source = a1.List.GetRange(a2.List.Count, counts[i]); //获得源文件比当前文件多的贴图集合 source.ForEach(e => { e.Load(); e.Parent = a2; }); a2.List.AddRange(source); //加入到当前文件中,不修改原贴图。 } i++; }, array); }
public void Do(params object[] args) { currents = args as Album[]; if (currents == null) { return; } olds = new Album[currents.Length]; var i = 0; var dir = NpkCoder.IMAGE_DIR; if (currents.Length > 0) { if (Regex.IsMatch(currents[0].Path, "^sounds/.*\\.ogg$")) { dir = NpkCoder.SOUND_DIR; } } NpkCoder.Compare(GamePath, dir, (a1, a2) => { var old = new Album(); old.Replace(a2); //保存旧文件 a2.Replace(a1); //替换为源文件 olds[i++] = old; }, currents); }
public void Action(params Album[] array) { NpkCoder.Compare(GamePath, (a1, a2) => { var count = a1.List.Count - a2.List.Count; if (count <= 0) { return; } var source = a1.List.GetRange(a2.List.Count, count); source.ForEach(e => { e.Load(); e.Parent = a2; }); a2.List.AddRange(source); }, array); }
public void Action(params Album[] array) { NpkCoder.Compare(GamePath, (a1, a2) => a1.Replace(a2), array); }