SettingsService
- Namespace: Turian.Engine.Core
- Source File: SettingsService.cs
Holds the open project and tells whoever is listening when another one is opened.
Fields
AssetsFolderName (string) = "Assets": The folder every project keeps its assets in.
LegacyProjectFileName (string) = "project.data": The file older projects kept at their root. It is still accepted wherever a project path is, and names that project's folder.
Properties
Settings
(AppSettings?) { get; set }: Holds the current loaded settings.
HasSettings
(bool): Indicates whether the settings have been loaded.
Public Methods
Load
public static AppSettings? Load(string path)
The project at a path: a project folder, or an older project's project.data naming it. The settings assets are not read; ProjectSettingsLoader does that.
Parameters:
path(string): A project folder, or a file inside one.
Returns: AppSettings?
- The project, or null when the path is not one.
Set
public AppSettings Set(AppSettings settings)
Sets the loaded settings and triggers the event.
Parameters:
settings(AppSettings)
Returns: AppSettings
IsValid
public static bool IsValid(string path)
Whether a path names a project: a folder holding Assets, or a file inside one.
Parameters:
path(string): The path to test.
Returns: bool
- True for a project.
ResolveProjectDirectory
public static string? ResolveProjectDirectory(string? path)
The project folder a path names — the folder itself, or the folder a file such as an older project.data sits in — provided it holds an Assets folder.
Parameters:
path(string?): A folder or a file path.
Returns: string?
- The absolute project folder, or null when the path is not a project.