mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-02 04:39:14 +01:00
Keep scenery files intact on save and follow them on disk
Saves keep comments and every byte they do not change. Faults in a scenery's text are found and described. Files that change while the starter runs are picked up without a manual reload.
This commit is contained in:
16
StarterNG.Tests/Fakes/TestScenery.cs
Normal file
16
StarterNG.Tests/Fakes/TestScenery.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using StarterNG.Application.Abstractions;
|
||||
using StarterNG.Infrastructure.Adapters;
|
||||
using StarterNG.Infrastructure.Sceneries;
|
||||
|
||||
namespace StarterNG.Tests.Fakes;
|
||||
|
||||
/// <summary>The scenery reader over a fake clock and dice, for tests of what it makes of a text.</summary>
|
||||
public static class TestScenery
|
||||
{
|
||||
/// <param name="now">The hour a scenery that names none starts at.</param>
|
||||
public static SceneryParser Parser(DateTime? now = null) =>
|
||||
new(new FixedClock(now ?? new DateTime(2026, 1, 1, 12, 0, 0)), new StubRandom());
|
||||
|
||||
public static SceneryRepository Repository(IFileSystem files) =>
|
||||
new(files, new GamePaths("game"), TestLog.Over(files), Parser());
|
||||
}
|
||||
Reference in New Issue
Block a user