flat snapshot record per aggregate - separate files mean saving a run doesn't rewrite the Profile, deleting a slot is deleting a file, and a corrupt slot doesn't cost achievements or best times. snapshots hold primitives so Restore re-runs the value-object factories; a serialiser building LevelId directly would bypass every guard. LoadResult has three outcomes: Absent != Corrupt. Collapsing them is the bug where a version bump made ContinueGame overwrite the save. Profile.Restore writes collections directly - replaying UnlockAchievement would re-fire popups and Steam pushes on every load. 44 tests.
13 lines
346 B
C#
13 lines
346 B
C#
namespace Mr.BrickAdventures.Progression;
|
|
|
|
/// <summary>
|
|
/// Where the Profile is kept. One per installation, in its own file, so unlocking an achievement
|
|
/// never rewrites a Playthrough and a corrupt slot never costs best times.
|
|
/// </summary>
|
|
public interface IProfileStore
|
|
{
|
|
void Save(Profile profile);
|
|
|
|
LoadResult<Profile> Load();
|
|
}
|