Firstborn/Library/PackageCache/com.unity.shadergraph@12.1.8/Editor/Generation/Collections/DependencyCollection.cs
Schaken-Mods b486678290 Library -Artifacts
Library -Artifacts
2023-03-28 12:24:16 -05:00

52 lines
1.2 KiB
C#

using System.Collections;
using System.Collections.Generic;
namespace UnityEditor.ShaderGraph
{
[GenerationAPI]
internal class DependencyCollection : IEnumerable<DependencyCollection.Item>
{
public class Item
{
public FieldDependency dependency { get; }
public Item(FieldDependency dependency)
{
this.dependency = dependency;
}
}
readonly List<DependencyCollection.Item> m_Items;
public DependencyCollection()
{
m_Items = new List<DependencyCollection.Item>();
}
public DependencyCollection Add(DependencyCollection dependencies)
{
foreach (DependencyCollection.Item item in dependencies)
{
m_Items.Add(item);
}
return this;
}
public DependencyCollection Add(FieldDependency dependency)
{
m_Items.Add(new Item(dependency));
return this;
}
public IEnumerator<DependencyCollection.Item> GetEnumerator()
{
return m_Items.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
}