forked from KSP-ModularManagement/ModuleManager
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPass.cs
More file actions
32 lines (26 loc) · 942 Bytes
/
Copy pathPass.cs
File metadata and controls
32 lines (26 loc) · 942 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System;
using System.Collections;
using System.Collections.Generic;
using ModuleManager.Patches;
namespace ModuleManager
{
public interface IPass : IEnumerable<IPatch>
{
string Name { get; }
}
public class Pass : IPass
{
private readonly string name;
private readonly List<IPatch> patches = new List<IPatch>(0);
public Pass(string name)
{
this.name = name ?? throw new ArgumentNullException(nameof(name));
if (name == string.Empty) throw new ArgumentException("can't be empty", nameof(name));
}
public string Name => name;
public void Add(IPatch patch) => patches.Add(patch);
public List<IPatch>.Enumerator GetEnumerator() => patches.GetEnumerator();
IEnumerator<IPatch> IEnumerable<IPatch>.GetEnumerator() => GetEnumerator();
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
}
}