Singularity/Library/PackageCache/com.unity.collab-proxy@2.0.3/Editor/PlasticSCM/Views/Diff/GetClientDiffInfos.cs
2024-05-06 11:45:45 -07:00

34 lines
897 B
C#

using System.Collections.Generic;
using Codice.Utils;
using PlasticGui.WorkspaceWindow.Diff;
namespace Unity.PlasticSCM.Editor.Views.Diff
{
internal static class GetClientDiffInfos
{
internal static List<ClientDiffInfo> FromCategories(List<IDiffCategory> categories)
{
List<ClientDiffInfo> result = new List<ClientDiffInfo>();
foreach (ITreeViewNode node in categories)
AddClientDiffInfos(node, result);
return result;
}
static void AddClientDiffInfos(ITreeViewNode node, List<ClientDiffInfo> result)
{
if (node is ClientDiffInfo)
{
result.Add((ClientDiffInfo)node);
return;
}
for (int i = 0; i < node.GetChildrenCount(); i++)
AddClientDiffInfos(node.GetChild(i), result);
}
}
}