forked from Misaki/GhostEngine
Refactor Vector3Field and update project structure
Changed Vector3Field.cs to derive from ValueControl<Vector3> and use NumberBox controls for better UI handling. Changed EditorControls.xaml to update resource paths for new controls. Changed InternalControls.xaml to simplify the resource dictionary by removing unnecessary references. Changed IComponentEditor.cs to reflect updates in the component editor's lifecycle methods. Changed project files for Ghost.Editor and Ghost.Core to include new dependencies and project references. Changed FileExtensions.cs and IInspectorService.cs to align with the new namespace structure. Changed Result.cs to enhance error handling and success checking methods. Changed TypeHandle.cs to improve type handling compatibility. Changed AssemblyInfo.cs files to include new assembly visibility attributes for better encapsulation. Added new graphics-related classes and interfaces in the Ghost.Engine project, including IGraphicsDevice and DX12GraphicsDevice. Added a new Mesh class to handle 3D mesh data and provide methods for creating geometric shapes. Added GraphicsPipeline.cs to manage the graphics rendering loop and device initialization. Added ScenePage.xaml and ScenePage.xaml.cs to create a new page for rendering scenes. Updated HierarchyPage.xaml.cs and InspectorPage.xaml.cs to use the new service locator pattern for service retrieval. Updated LandingWindow.xaml.cs and EngineEditorWindow.xaml.cs to utilize the new service locator pattern for better service access. Updated Logger.cs to enhance logging capabilities with optional stack traces and assertion logging. Updated QueryFilter.cs and QueryEnumerable.cs to use the new TypeHandle structure for improved efficiency. Updated WorldNode.cs and WorldNodeSerializer.cs to enhance serialization and management of world nodes. Updated AssetDatabase and related classes to improve asset management and metadata generation. Updated Ghost.UnitTest.csproj to include new project references and package dependencies for unit tests.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using Ghost.Entities.Utilities;
|
||||
using Ghost.Core;
|
||||
using Misaki.HighPerformance.Unsafe.Collections;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.CompilerServices;
|
||||
@@ -463,8 +463,8 @@ internal class ScriptComponentPool : IComponentPool<ScriptComponent>
|
||||
[SkipLocalsInit]
|
||||
internal readonly struct ComponentStorage : IDisposable
|
||||
{
|
||||
private readonly Dictionary<nint, IComponentPool> _componentPools = new();
|
||||
private readonly Dictionary<nint, BitSet> _componentEntityMasks = new();
|
||||
private readonly Dictionary<TypeHandle, IComponentPool> _componentPools = new();
|
||||
private readonly Dictionary<TypeHandle, BitSet> _componentEntityMasks = new();
|
||||
private readonly ScriptComponentPool _scriptComponentPool = new();
|
||||
|
||||
private readonly World _world;
|
||||
@@ -474,12 +474,12 @@ internal readonly struct ComponentStorage : IDisposable
|
||||
_world = world;
|
||||
}
|
||||
|
||||
internal Dictionary<nint, IComponentPool> ComponentPools => _componentPools;
|
||||
internal Dictionary<nint, BitSet> ComponentEntityMasks => _componentEntityMasks;
|
||||
internal Dictionary<TypeHandle, IComponentPool> ComponentPools => _componentPools;
|
||||
internal Dictionary<TypeHandle, BitSet> ComponentEntityMasks => _componentEntityMasks;
|
||||
internal ScriptComponentPool ScriptComponentPool => _scriptComponentPool;
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool TryGetPool(nint typeHandle, [MaybeNullWhen(false)] out IComponentPool pool)
|
||||
public bool TryGetPool(TypeHandle typeHandle, [MaybeNullWhen(false)] out IComponentPool pool)
|
||||
{
|
||||
return _componentPools.TryGetValue(typeHandle, out pool);
|
||||
}
|
||||
@@ -514,7 +514,7 @@ internal readonly struct ComponentStorage : IDisposable
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool TryGetMask(nint typeHandle, [MaybeNullWhen(false)] out BitSet bitSet)
|
||||
public bool TryGetMask(TypeHandle typeHandle, [MaybeNullWhen(false)] out BitSet bitSet)
|
||||
{
|
||||
return _componentEntityMasks.TryGetValue(typeHandle, out bitSet);
|
||||
}
|
||||
@@ -522,7 +522,7 @@ internal readonly struct ComponentStorage : IDisposable
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool TryGetMask(Type type, [MaybeNullWhen(false)] out BitSet bitSet)
|
||||
{
|
||||
return TryGetMask(type.TypeHandle.Value, out bitSet);
|
||||
return TryGetMask(TypeHandle.Get(type), out bitSet);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -532,7 +532,7 @@ internal readonly struct ComponentStorage : IDisposable
|
||||
return TryGetMask(TypeHandle.Get<T>(), out bitSet);
|
||||
}
|
||||
|
||||
public BitSet GetOrCreateMask(nint typeHandle)
|
||||
public BitSet GetOrCreateMask(TypeHandle typeHandle)
|
||||
{
|
||||
if (!_componentEntityMasks.TryGetValue(typeHandle, out var mask))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user