You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.3 KiB
53 lines
1.3 KiB
2 years ago
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
|
||
|
namespace UnityEditor.ShaderGraph
|
||
|
{
|
||
|
[GenerationAPI]
|
||
|
internal class AdditionalCommandCollection : IEnumerable<AdditionalCommandCollection.Item>
|
||
|
{
|
||
|
public class Item
|
||
|
{
|
||
|
public AdditionalCommandDescriptor field { get; }
|
||
|
|
||
|
public Item(AdditionalCommandDescriptor field)
|
||
|
{
|
||
|
this.field = field;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
readonly List<AdditionalCommandCollection.Item> m_Items;
|
||
|
|
||
|
public AdditionalCommandCollection()
|
||
|
{
|
||
|
m_Items = new List<AdditionalCommandCollection.Item>();
|
||
|
}
|
||
|
|
||
|
public AdditionalCommandCollection Add(AdditionalCommandCollection fields)
|
||
|
{
|
||
|
foreach (AdditionalCommandCollection.Item item in fields)
|
||
|
{
|
||
|
m_Items.Add(item);
|
||
|
}
|
||
|
|
||
|
return this;
|
||
|
}
|
||
|
|
||
|
public AdditionalCommandCollection Add(AdditionalCommandDescriptor field)
|
||
|
{
|
||
|
m_Items.Add(new Item(field));
|
||
|
return this;
|
||
|
}
|
||
|
|
||
|
public IEnumerator<AdditionalCommandCollection.Item> GetEnumerator()
|
||
|
{
|
||
|
return m_Items.GetEnumerator();
|
||
|
}
|
||
|
|
||
|
IEnumerator IEnumerable.GetEnumerator()
|
||
|
{
|
||
|
return GetEnumerator();
|
||
|
}
|
||
|
}
|
||
|
}
|