mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-10-16 23:49:19 +02:00
Load vehicles from a JSON copy of textures.txt, rebuilt when the installation changes
This commit is contained in:
@@ -134,6 +134,8 @@ public sealed class InMemoryFileSystem : IFileSystem
|
||||
public DateTime GetLastWriteTimeUtc(string path) => LastWriteTimeUtc;
|
||||
|
||||
/// <summary>Files added through <see cref="WithExecutable"/> carry the execute bit.</summary>
|
||||
public long GetFileSize(string path) => Bytes(path).LongLength;
|
||||
|
||||
public bool IsExecutable(string path) => _executable.Contains(Normalize(path));
|
||||
|
||||
public InMemoryFileSystem WithExecutable(string path, string contents = "\u007fELF")
|
||||
|
||||
@@ -26,12 +26,15 @@ public sealed class TestInstallation
|
||||
MiniTextures = new MiniTextureIndex(Files, Paths);
|
||||
Physics = new FizPhysicsRepository(Files, Paths, Log);
|
||||
Vehicles = new TexturesTxtVehicleRepository(Files, Paths, Log, new TexturesTxtParser());
|
||||
VehicleJson = new VehicleJsonSerializer();
|
||||
Sceneries = new SceneryRepository(Files, Paths, Log, new SceneryParser(Clock, Random));
|
||||
MissingAssets = new MissingAssetScanner(Files, Paths);
|
||||
Library = new GameLibrary(Vehicles, Sceneries, MiniTextures, Physics, Log);
|
||||
|
||||
Environment = new FakeEnvironment();
|
||||
SettingsPaths = new SettingsPaths(Environment, Paths);
|
||||
VehicleCache = new VehicleCacheRepository(Files, Paths, Log, Vehicles, VehicleJson,
|
||||
SettingsPaths.VehicleCacheDirectory());
|
||||
Library = new GameLibrary(VehicleCache, Sceneries, MiniTextures, Physics, Log);
|
||||
|
||||
Executables = new ExecutableLocator(Files, Paths, Environment, Log);
|
||||
SettingsStore = new SettingsStore(Files, Clock, Log, SettingsPaths, new SettingsSerializer(), Executables);
|
||||
}
|
||||
@@ -45,6 +48,8 @@ public sealed class TestInstallation
|
||||
public MiniTextureIndex MiniTextures { get; }
|
||||
public FizPhysicsRepository Physics { get; }
|
||||
public TexturesTxtVehicleRepository Vehicles { get; }
|
||||
public VehicleJsonSerializer VehicleJson { get; }
|
||||
public VehicleCacheRepository VehicleCache { get; }
|
||||
public SceneryRepository Sceneries { get; }
|
||||
public MissingAssetScanner MissingAssets { get; }
|
||||
public GameLibrary Library { get; }
|
||||
|
||||
Reference in New Issue
Block a user