-
Notifications
You must be signed in to change notification settings - Fork 0
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
13 changed files
with
302 additions
and
68 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
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,27 @@ | ||
using System.Collections.Immutable; | ||
using SightKeeper.Data.Binary.Conversion.DataSets; | ||
using SightKeeper.Data.Binary.Conversion.Profiles; | ||
using SightKeeper.Data.Binary.Services; | ||
|
||
namespace SightKeeper.Data.Binary.Conversion; | ||
|
||
internal sealed class AppDataConverter | ||
{ | ||
public AppDataConverter(FileSystemScreenshotsDataAccess screenshotsDataAccess) | ||
{ | ||
_screenshotsDataAccess = screenshotsDataAccess; | ||
} | ||
|
||
public PackableAppData Convert(AppData data) | ||
{ | ||
ConversionSession session = new(); | ||
var games = GamesConverter.Convert(data.Games, session); | ||
MultiDataSetConverter dataSetConverter = new(_screenshotsDataAccess, session); | ||
var dataSets = dataSetConverter.Convert(data.DataSets); | ||
ProfileConverter profileConverter = new(session); | ||
var profiles = profileConverter.Convert(data.Profiles).ToImmutableArray(); | ||
return new PackableAppData(games, dataSets, profiles, data.ApplicationSettings); | ||
} | ||
|
||
private readonly FileSystemScreenshotsDataAccess _screenshotsDataAccess; | ||
} |
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,25 @@ | ||
using SightKeeper.Data.Binary.Replication.DataSets; | ||
using SightKeeper.Data.Binary.Replication.Profiles; | ||
using SightKeeper.Data.Binary.Services; | ||
|
||
namespace SightKeeper.Data.Binary.Replication; | ||
|
||
internal class AppDataReplicator | ||
{ | ||
public AppDataReplicator(FileSystemScreenshotsDataAccess screenshotsDataAccess) | ||
{ | ||
_screenshotsDataAccess = screenshotsDataAccess; | ||
} | ||
|
||
public AppData Replicate(PackableAppData packed) | ||
{ | ||
ReplicationSession session = new(); | ||
var games = GameReplicator.Replicate(packed.Games, session); | ||
MultiDataSetReplicator dataSetReplicator = new(_screenshotsDataAccess, session); | ||
var dataSets = dataSetReplicator.Replicate(packed.DataSets); | ||
var profiles = new ProfileReplicator(session).Replicate(packed.Profiles).ToHashSet(); | ||
return new AppData(games, dataSets, profiles, packed.ApplicationSettings); | ||
} | ||
|
||
private readonly FileSystemScreenshotsDataAccess _screenshotsDataAccess; | ||
} |
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
Oops, something went wrong.