File tree Expand file tree Collapse file tree
src/PetroglyphTools/PG.StarWarsGame.Engine.FileSystem/IO Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,14 +41,16 @@ public sealed partial class PetroglyphFileSystem
4141 /// <param name="windowsFallback">
4242 /// <see langword="true" /> to delegate outside-game-directory lookups to the Windows
4343 /// <c>CreateFileA</c> strategy; <see langword="false" /> to delegate them to the Wine search
44- /// engine, which works on every host.
44+ /// engine; <see langword="null" /> to pick the Windows strategy on Windows hosts and the Wine
45+ /// strategy otherwise.
4546 /// </param>
4647 /// <exception cref="PlatformNotSupportedException">
4748 /// <paramref name="windowsFallback"/> is <see langword="true" /> and the host is not Windows.
4849 /// </exception>
49- public void UseVirtualStrategy ( bool windowsFallback = false )
50+ public void UseVirtualStrategy ( bool ? windowsFallback = null )
5051 {
51- FileExistsStrategy fallback = windowsFallback
52+ var useWindows = windowsFallback ?? RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) ;
53+ FileExistsStrategy fallback = useWindows
5254 ? CreateWindowsStrategy ( )
5355 : new WineFileExistsStrategy ( _underlyingFileSystem ) ;
5456 UseVirtualStrategy ( fallback ) ;
You can’t perform that action at this time.
0 commit comments