A game about forced loneliness, made by TACStudios
1using System.Collections;
2using System.Collections.Generic;
3
4namespace UnityEditor.ShaderGraph
5{
6 [GenerationAPI]
7 internal class FieldCollection : IEnumerable<FieldCollection.Item>
8 {
9 public class Item
10 {
11 public FieldDescriptor field { get; }
12
13 public Item(FieldDescriptor field)
14 {
15 this.field = field;
16 }
17 }
18
19 readonly List<FieldCollection.Item> m_Items;
20
21 public FieldCollection()
22 {
23 m_Items = new List<FieldCollection.Item>();
24 }
25
26 public FieldCollection Add(FieldCollection fields)
27 {
28 foreach (FieldCollection.Item item in fields)
29 {
30 m_Items.Add(item);
31 }
32
33 return this;
34 }
35
36 public FieldCollection Add(FieldDescriptor field)
37 {
38 m_Items.Add(new Item(field));
39 return this;
40 }
41
42 public IEnumerator<FieldCollection.Item> GetEnumerator()
43 {
44 return m_Items.GetEnumerator();
45 }
46
47 IEnumerator IEnumerable.GetEnumerator()
48 {
49 return GetEnumerator();
50 }
51 }
52}