This repository has been archived by the owner on Jun 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
46 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System.IO; | ||
using System.Runtime.Serialization; | ||
using ModSink.Common.Client; | ||
using ModSink.Core; | ||
using ModSink.Core.Client; | ||
|
||
namespace ModSink.Common | ||
{ | ||
public class ModSinkBuilder | ||
{ | ||
private IDownloader downloader; | ||
private IFormatter formatter; | ||
private DirectoryInfo localStorageDirectory; | ||
|
||
public ModSinkBuilder WithDownloader(IDownloader downloader) | ||
{ | ||
this.downloader = downloader; | ||
return this; | ||
} | ||
|
||
public ModSinkBuilder WithFormatter(IFormatter formatter) | ||
{ | ||
this.formatter = formatter; | ||
return this; | ||
} | ||
|
||
public ModSinkBuilder InDirectory(DirectoryInfo directory) | ||
{ | ||
localStorageDirectory = directory; | ||
return this; | ||
} | ||
|
||
public IModSink Build() | ||
{ | ||
return new ModSink(new ClientService(new DownloadService(downloader), | ||
new LocalStorageService(localStorageDirectory), downloader, formatter)); | ||
} | ||
} | ||
} |
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