Refactor application structure and add unit tests
Added: - New `ProgressService` class for managing progress indicators. - New `AssetDatabase`, `AssetOpenHandlerAttribute`, and `AsyncAssetOpenHandlerAttribute` classes for asset handling. - `Ghost.UnitTest` project for unit testing with associated files and configurations. Changed: - `ActivationHandler` class to ensure correct handling of `LaunchActivatedEventArgs`. - `App.xaml.cs` to register `INotificationService` and `IProgressService`, replacing `StackedNotificationService`. - `OnLaunched` method in `App.xaml.cs` to correctly call `ActivationHandler.Handle(args)` and start the host. - `INavigationAware` interface from internal to public for broader access. - `EditorState.cs` to activate `EditorApplication` with the current service provider. - Property names in `AssetItem` and `ExplorerItem` structs to `Name` and `FullName`. - `NotificationService` class to implement `INotificationService` and refactor notification handling. - `AssetPathToGlyphConverter` to handle file extensions consistently. - Bindings in `ProjectPage.xaml` and `ProjectPage.xaml.cs` to use `FullName` instead of `Path`. - `EngineEditorWindow` and `LandingWindow` classes to utilize new notification and progress services. - `Logger` class to include a new method for logging errors with exceptions. Updated: - Manifest files and project files to reflect new structure and dependencies. - Solution file `GhostEngine.sln` to include the new unit test project. - Added several new test classes and methods in `UnitTests.cs`.
This commit is contained in:
24
Ghost.Editor/Models/Asset.cs
Normal file
24
Ghost.Editor/Models/Asset.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
namespace Ghost.Editor.Models;
|
||||
|
||||
public abstract class Asset
|
||||
{
|
||||
/// <summary>
|
||||
/// Get the Guid of the asset.
|
||||
/// </summary>
|
||||
public Guid GUID
|
||||
{
|
||||
get;
|
||||
} = Guid.NewGuid();
|
||||
|
||||
/// <summary>
|
||||
/// True if the asset is a folder, false if it is a file.
|
||||
/// </summary>
|
||||
public bool IsFolder
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
internal void GenerateMetadata()
|
||||
{
|
||||
}
|
||||
}
|
||||
9
Ghost.Editor/Models/MessageType.cs
Normal file
9
Ghost.Editor/Models/MessageType.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace Ghost.Editor.Models;
|
||||
|
||||
public enum MessageType
|
||||
{
|
||||
Informational,
|
||||
Success,
|
||||
Warning,
|
||||
Error
|
||||
}
|
||||
14
Ghost.Editor/Models/WorldAsset.cs
Normal file
14
Ghost.Editor/Models/WorldAsset.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using Ghost.Editor.AssetHandle;
|
||||
using Ghost.Editor.Resources;
|
||||
using Ghost.Editor.SceneGraph;
|
||||
|
||||
namespace Ghost.Editor.Models;
|
||||
|
||||
public class WorldAsset : Asset
|
||||
{
|
||||
[AsyncAssetOpenHandler(FileExtensions.SCENE_FILE_EXTENSION)]
|
||||
public static async Task Open(string path)
|
||||
{
|
||||
await EditorWorldManager.LoadWorld(path);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user