Files
sbox-public/engine/Sandbox.Engine/Systems/Filesystem/FileSystem.cs
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

42 lines
1.4 KiB
C#

using Sandbox.Engine;
namespace Sandbox;
/// <summary>
/// A filesystem that can be accessed by the game.
/// </summary>
public static class FileSystem
{
/// <summary>
/// Normalizes given file path so the game's filesystem can understand it. Fixes slashes and lowercases the file path.
/// </summary>
/// <param name="filepath">The file path to normalize</param>
/// <returns>The normalized file path</returns>
public static string NormalizeFilename( string filepath ) => BaseFileSystem.NormalizeFilename( filepath );
/// <summary>
/// All mounted content.
/// </summary>
public static BaseFileSystem Mounted => GlobalContext.Current.FileMount;
/// <summary>
/// A subset of <see cref="OrganizationData"/> for custom gamemode data.
/// </summary>
public static BaseFileSystem Data => GlobalContext.Current.FileData;
/// <summary>
/// A filesystem for custom data, per gamemode's organization.
/// </summary>
public static BaseFileSystem OrganizationData => GlobalContext.Current.FileOrg;
/// <summary>
/// A cached keystore that can be used for anything. This is stored in a global cache folder, and may be deleted at any time.
/// </summary>
public static KeyStore Cache = KeyStore.CreateGlobalCache();
/// <summary>
/// Create a filesystem that exists only in memory
/// </summary>
public static BaseFileSystem CreateMemoryFileSystem() => new MemoryFileSystem();
}