Refactor activation handling and introduce entity system
Added new `ActivationHandler` class for folder initialization. Added `ProjectService` class for project-related operations. Added `Ghost.Entities` project with entity management classes. Added `EngineEditorWindow` for enhanced user interface. Changed project files to restructure dependencies and remove unused references. Changed `ProjectRepository` to use asynchronous methods for improved performance. Changed data binding in `CreateProjectPage.xaml` and `OpenProjectPage.xaml` to use new data models. Changed `App.xaml.cs` to utilize the new `ActivationHandler` and include additional services. Removed `IActivationHandler` interface and integrated its functionality into `ActivationHandler`. Removed `EditorActivationHandler` as its functionality was merged into `ActivationHandler`. Updated `AssemblyInfo.cs` to include global using directives for entity types. Updated image assets to reflect visual resource changes.
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
namespace Ghost.Engine.Models;
|
||||
|
||||
public class Component
|
||||
public abstract class Component
|
||||
{
|
||||
public required GameEntity Owner
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
18
Ghost.Engine/Models/GameEntity.cs
Normal file
18
Ghost.Engine/Models/GameEntity.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace Ghost.Engine.Models;
|
||||
|
||||
public abstract class GameEntity
|
||||
{
|
||||
private ObservableCollection<Component> _components = new();
|
||||
|
||||
public GameEntity()
|
||||
{
|
||||
//AddComponent(new Transform());
|
||||
}
|
||||
|
||||
public void AddComponent(Component component)
|
||||
{
|
||||
_components.Add(component);
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
using Ghost.Engine.Components;
|
||||
|
||||
namespace Ghost.Engine.Models;
|
||||
|
||||
public class GameObject
|
||||
{
|
||||
private List<Component> _components = new();
|
||||
|
||||
public GameObject()
|
||||
{
|
||||
AddComponent(new Transform());
|
||||
}
|
||||
|
||||
public void AddComponent(Component component)
|
||||
{
|
||||
_components.Add(component);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user