forked from Misaki/GhostEngine
Refactor project structure and improve performance
Changed the `ProjectRepository` class to be static for easier usage. Changed `ProjectService` constants to public properties for accessibility. Changed `App.xaml` to consolidate theme resources into `Override.xaml`. Changed `App.xaml.cs` to implement an `AppStateMachine` for better state management. Changed `ConsolePage` and `HierarchyPage` to utilize the new ViewModel structure. Changed `ProjectPage` to use the `ExplorerItem` model for asset display. Changed `Entity` and `EntityManager` to enhance component management with a new `IComponentData` interface. Changed the `Logger` class to introduce structured logging functionality. Changed the system architecture to support dependency management for better organization. Changed the `QueryEnumerable` class to allow for more flexible entity queries. Changed the `TypeHandle` class to improve efficiency in retrieving type handles. Changed the `World` class to support robust world management and multiple worlds. Updated the `Test` class to demonstrate the new entity and component management system.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
using Ghost.Editor.AppStates;
|
||||
using Ghost.Editor.Helpers;
|
||||
using Ghost.Editor.Helpers;
|
||||
using Ghost.Editor.Infrastructures.AppState;
|
||||
using Ghost.Editor.Services;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
@@ -20,7 +20,7 @@ namespace Ghost.Editor
|
||||
|
||||
internal static Window? Window
|
||||
{
|
||||
get => (Current as App)?._window;
|
||||
get => (Current as App)!._window;
|
||||
set
|
||||
{
|
||||
if (Current is App app)
|
||||
@@ -48,16 +48,10 @@ namespace Ghost.Editor
|
||||
UseContentRoot(AppContext.BaseDirectory).
|
||||
ConfigureServices((context, services) =>
|
||||
{
|
||||
services.AddSingleton(sp =>
|
||||
{
|
||||
return new AppStateService(
|
||||
new LandingState(),
|
||||
new EditorState());
|
||||
});
|
||||
|
||||
HostHelper.AddLandingScope(context, services);
|
||||
HostHelper.AddEngineScope(context, services);
|
||||
|
||||
services.AddSingleton<AppStateMachine>();
|
||||
services.AddSingleton<StackedNotificationService>();
|
||||
})
|
||||
.Build();
|
||||
@@ -92,7 +86,11 @@ namespace Ghost.Editor
|
||||
|
||||
Host.Start();
|
||||
|
||||
await GetService<AppStateService>().TransitionToAsync(StateKey.Landing);
|
||||
var stateMachine = GetService<AppStateMachine>();
|
||||
stateMachine.RegisterState(StateKey.Landing, () => new LandingState());
|
||||
stateMachine.RegisterState(StateKey.EngineEditor, () => new EditorState());
|
||||
|
||||
await stateMachine.TransitionToAsync(StateKey.Landing);
|
||||
}
|
||||
|
||||
private void App_UnhandledException(object sender, Microsoft.UI.Xaml.UnhandledExceptionEventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user