Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract interface for PatchList, modify PatchExtractor
PatchExtractor did too much at once, it shouldn't enumerate and extract at the same time (still some work to be done there...). PatchList now has a clearer interface and obscures more of the details - iterating through patches is now handled by it rater than PatchApplier
- Loading branch information
1 parent
f96c333
commit 83288b5
Showing
12 changed files
with
1,419 additions
and
624 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
|
||
namespace ModuleManager | ||
{ | ||
public interface IPass : IEnumerable<Patch> | ||
{ | ||
string Name { get; } | ||
} | ||
|
||
public class Pass : IPass | ||
{ | ||
private readonly string name; | ||
private readonly List<Patch> patches = new List<Patch>(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(Patch patch) => patches.Add(patch); | ||
|
||
public List<Patch>.Enumerator GetEnumerator() => patches.GetEnumerator(); | ||
IEnumerator<Patch> IEnumerable<Patch>.GetEnumerator() => GetEnumerator(); | ||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.