diff --git a/Ghost.Core/Contracts/InternalRelease.cs b/Ghost.Core/Contracts/InternalRelease.cs
new file mode 100644
index 0000000..5497ddb
--- /dev/null
+++ b/Ghost.Core/Contracts/InternalRelease.cs
@@ -0,0 +1,6 @@
+namespace Ghost.Core.Contracts;
+
+internal interface IReleasable
+{
+ void InternalRelease();
+}
\ No newline at end of file
diff --git a/Ghost.Core/Ghost.Core.csproj b/Ghost.Core/Ghost.Core.csproj
index db00b21..472f205 100644
--- a/Ghost.Core/Ghost.Core.csproj
+++ b/Ghost.Core/Ghost.Core.csproj
@@ -7,7 +7,18 @@
True
+
+ True
+ $(DefineConstants);PLATEFORME_WIN64
+
+
+
+ True
+ $(DefineConstants);PLATEFORME_WIN64
+
+
+
@@ -17,9 +28,5 @@
-
-
-
-
diff --git a/Ghost.Core/Graphics/ShaderDescriptor.cs b/Ghost.Core/Graphics/ShaderDescriptor.cs
index 5af12be..6be9979 100644
--- a/Ghost.Core/Graphics/ShaderDescriptor.cs
+++ b/Ghost.Core/Graphics/ShaderDescriptor.cs
@@ -1,4 +1,5 @@
namespace Ghost.Core.Graphics;
+
public enum KeywordType
{
Static,
@@ -20,6 +21,8 @@ public struct ShaderEntryPoint
{
public string entry;
public string shader;
+
+ public readonly bool IsCreated => !string.IsNullOrEmpty(entry) && !string.IsNullOrEmpty(shader);
}
public struct KeywordsGroup
@@ -52,27 +55,11 @@ public interface IPassDescriptor
{
get;
}
-}
-public class FullPassDescriptor : IPassDescriptor
-{
- public string uniqueIdentifier = string.Empty;
- public ShaderEntryPoint vertexShader;
- public ShaderEntryPoint pixelShader;
- public List? defines;
- public List? includes;
- public List? keywords;
- public List? properties;
- public PipelineDescriptor localPipeline;
-
- public string Identifier => uniqueIdentifier;
-}
-
-public class FallbackPassDescriptor : IPassDescriptor
-{
- public string fallbackPassIdentifier = string.Empty;
-
- public string Identifier => fallbackPassIdentifier;
+ public string Name
+ {
+ get;
+ }
}
public struct PropertyDescriptor
@@ -82,6 +69,33 @@ public struct PropertyDescriptor
public object? defaultValue;
}
+public class FullPassDescriptor : IPassDescriptor
+{
+ public string uniqueIdentifier = string.Empty;
+ public string name = string.Empty;
+
+ public ShaderEntryPoint taskShader;
+ public ShaderEntryPoint meshShader;
+ public ShaderEntryPoint pixelShader;
+ public List? defines;
+ public List? includes;
+ public List? keywords;
+ public List? properties;
+ public PipelineDescriptor localPipeline;
+
+ public string Identifier => uniqueIdentifier;
+ public string Name => name;
+}
+
+public class FallbackPassDescriptor : IPassDescriptor
+{
+ public string fallbackPassIdentifier = string.Empty;
+ public string name = string.Empty;
+
+ public string Identifier => fallbackPassIdentifier;
+ public string Name => name;
+}
+
public class ShaderDescriptor
{
public string name = string.Empty;
diff --git a/Ghost.Core/Handle.cs b/Ghost.Core/Handle.cs
index 71ca15e..e7c3d6c 100644
--- a/Ghost.Core/Handle.cs
+++ b/Ghost.Core/Handle.cs
@@ -7,7 +7,6 @@ public readonly struct Handle
where T : IHandleType
{
public readonly int id;
-
public readonly int generation;
public Handle(int id, int generation)
@@ -22,7 +21,7 @@ public readonly struct Handle
public readonly override int GetHashCode()
{
- return id.GetHashCode();
+ return id + (generation << 16);
}
public readonly override bool Equals(object? obj)
diff --git a/Ghost.Core/Logging.cs b/Ghost.Core/Logging.cs
index 9b6d6f9..b90b5a7 100644
--- a/Ghost.Core/Logging.cs
+++ b/Ghost.Core/Logging.cs
@@ -9,7 +9,7 @@ public enum LogLevel
Error
}
-internal struct LogMessage
+internal readonly struct LogMessage
{
public LogLevel Level
{
@@ -58,10 +58,9 @@ internal interface ILogger
}
public void Log(string message, LogLevel level);
-
public void Log(Exception exception);
-
public void Assert(bool condition, string message);
+ public void Clear();
}
// TODO: Add file logging.
@@ -98,6 +97,14 @@ internal class LoggerImplementation : ILogger
}
}
}
+
+ public void Clear()
+ {
+ lock (_lock)
+ {
+ _logs.Clear();
+ }
+ }
}
public static class Logger
@@ -149,4 +156,14 @@ public static class Logger
{
s_logger.Log(ex);
}
+
+ public static void Assert(bool condition, string message)
+ {
+ s_logger.Assert(condition, message);
+ }
+
+ public static void Clear()
+ {
+ s_logger.Clear();
+ }
}
\ No newline at end of file
diff --git a/Ghost.Core/Result.cs b/Ghost.Core/Result.cs
index 28e44ba..fa8e908 100644
--- a/Ghost.Core/Result.cs
+++ b/Ghost.Core/Result.cs
@@ -17,20 +17,14 @@ public readonly struct Result
return new Result(true);
}
- public static Result Failure(string? message)
+ public static Result Fail(string? message)
{
return new Result(false, message);
}
- public void ThrowIfFailed()
- {
- if (!success)
- {
- throw new InvalidOperationException($"Operation failed: {message}");
- }
- }
-
public override string ToString() => success ? "OK" : $"Error: {message}";
+
+ public static implicit operator Result(bool success) => success ? Success() : Fail(null);
}
public readonly struct Result
@@ -52,18 +46,33 @@ public readonly struct Result
return new Result(true, data);
}
- public static Result Failure(string? message)
+ public static Result Fail(string? message)
{
return new Result(false, default!, message);
}
- public void ThrowIfFailed()
+ public override string ToString() => success ? $"OK: {value}" : $"Error: {message}";
+
+ public static implicit operator Result(T? data) => data is not null ? Success(data) : Fail(null);
+}
+
+public static class ResultExtensions
+{
+ public static void ThrowIfFailed(this Result result)
{
- if (!success)
+ if (!result.success)
{
- throw new InvalidOperationException($"Operation failed: {message}");
+ throw new InvalidOperationException($"Operation failed: {result.message}");
}
}
- public override string ToString() => success ? $"OK: {value}" : $"Error: {message}";
-}
+ public static T GetValueOrThrow(this Result result)
+ {
+ if (!result.success)
+ {
+ throw new InvalidOperationException($"Operation failed: {result.message}");
+ }
+
+ return result.value;
+ }
+}
\ No newline at end of file
diff --git a/Ghost.Core/Utilities/InternalResource.cs b/Ghost.Core/Utilities/InternalResource.cs
new file mode 100644
index 0000000..ff165ca
--- /dev/null
+++ b/Ghost.Core/Utilities/InternalResource.cs
@@ -0,0 +1,12 @@
+using Ghost.Core.Contracts;
+
+namespace Ghost.Core.Utilities;
+
+internal static class InternalResource
+{
+ public static void Release(ref T? resource)
+ where T : IReleasable
+ {
+ resource?.InternalRelease();
+ }
+}
\ No newline at end of file
diff --git a/Ghost.Graphics/D3D12/Utilities/Win32Utility.cs b/Ghost.Core/Utilities/Win32Utility.cs
similarity index 58%
rename from Ghost.Graphics/D3D12/Utilities/Win32Utility.cs
rename to Ghost.Core/Utilities/Win32Utility.cs
index d8a732e..91af020 100644
--- a/Ghost.Graphics/D3D12/Utilities/Win32Utility.cs
+++ b/Ghost.Core/Utilities/Win32Utility.cs
@@ -1,10 +1,22 @@
-using System.Runtime.CompilerServices;
+using System.Diagnostics;
+using System.Runtime.CompilerServices;
+using System.Runtime.Versioning;
using TerraFX.Interop.Windows;
-namespace Ghost.Graphics.D3D12.Utilities;
+namespace Ghost.Core.Utilities;
+#if PLATEFORME_WIN64
+[SupportedOSPlatform("windows10.0.19041.0")]
internal unsafe static class Win32Utility
{
+ public static Guid* IID_NULL => (Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in IID.IID_NULL));
+
+ [Conditional("DEBUG")]
+ public static void Assert(this HRESULT hr)
+ {
+ Debug.Assert(hr.SUCCEEDED);
+ }
+
public static void ThrowIfFailed(this HRESULT hr)
{
Windows.ThrowIfFailed(hr);
@@ -22,11 +34,11 @@ internal unsafe static class Win32Utility
return (void**)comPtr.ReleaseAndGetAddressOf();
}
- public static ComPtr Move(this ComPtr comPtr)
+ public static ComPtr Move(ref this ComPtr comPtr)
where T : unmanaged, IUnknown.Interface
{
- ComPtr copy = default;
- Unsafe.AsRef(in comPtr).Swap(ref copy);
+ var copy = default(ComPtr);
+ comPtr.Swap(ref copy);
return copy;
}
@@ -35,4 +47,5 @@ internal unsafe static class Win32Utility
{
return (flags & Unsafe.As(ref flag)) != 0;
}
-}
\ No newline at end of file
+}
+#endif
\ No newline at end of file
diff --git a/Ghost.Data/Services/ProjectService.cs b/Ghost.Data/Services/ProjectService.cs
index 575de35..9f3a2dd 100644
--- a/Ghost.Data/Services/ProjectService.cs
+++ b/Ghost.Data/Services/ProjectService.cs
@@ -75,29 +75,29 @@ internal partial class ProjectService
{
if (string.IsNullOrWhiteSpace(projectDirectory) || !Directory.Exists(projectDirectory))
{
- return Result.Failure("Project directory is invalid or does not exist.");
+ return Result.Fail("Project directory is invalid or does not exist.");
}
var projectAssetsPath = Path.Combine(projectDirectory, ASSETS_FOLDER);
var projectConfigPath = Path.Combine(projectDirectory, CONFIG_FOLDER);
if (!Directory.Exists(projectAssetsPath) || !Directory.Exists(projectConfigPath))
{
- return Result.Failure("Project folder structure is invalid.");
+ return Result.Fail("Project folder structure is invalid.");
}
var metadataPath = Directory.GetFiles(projectDirectory, $"*.{ProjectMetadata.PROJECT_EXTENSION}", SearchOption.TopDirectoryOnly).FirstOrDefault();
if (string.IsNullOrWhiteSpace(metadataPath) || !File.Exists(metadataPath))
{
- return Result.Failure("Project metadata file not found.");
+ return Result.Fail("Project metadata file not found.");
}
var metadata = await LoadMetadataAsync(metadataPath);
if (metadata == null)
{
- return Result.Failure("Project metadata file is corrupted or invalid.");
+ return Result.Fail("Project metadata file is corrupted or invalid.");
}
- return Result.Success(new(metadataPath, metadata));
+ return new ProjectMetadataInfo(metadataPath, metadata);
}
private static async ValueTask SetupRequestFolderAsync(string projectDirectory, string templateDirectory)
@@ -201,7 +201,7 @@ internal partial class ProjectService
}
catch (Exception e)
{
- return Result.Failure($"Failed to create project: {e.Message}");
+ return Result.Fail($"Failed to create project: {e.Message}");
}
}
@@ -215,7 +215,7 @@ internal partial class ProjectService
if (await HasProjectAsync(result.value.Path))
{
- return Result.Failure("Project already exists.");
+ return Result.Fail("Project already exists.");
}
await AddProjectAsync(result.value.Metadata.Name, result.value.Path);
diff --git a/Ghost.Editor.Core/AssetHandle/AssetDatabase.Meta.cs b/Ghost.Editor.Core/AssetHandle/AssetDatabase.Meta.cs
index 81a4c55..0369f0e 100644
--- a/Ghost.Editor.Core/AssetHandle/AssetDatabase.Meta.cs
+++ b/Ghost.Editor.Core/AssetHandle/AssetDatabase.Meta.cs
@@ -36,12 +36,12 @@ public static partial class AssetDatabase
{
if (Directory.Exists(assetPath))
{
- return Result.Failure("Folder does not have meta data");
+ return Result.Fail("Folder does not have meta data");
}
if (Path.GetExtension(assetPath).Equals(".meta", StringComparison.OrdinalIgnoreCase))
{
- return Result.Failure("Asset path cannot be a meta file");
+ return Result.Fail("Asset path cannot be a meta file");
}
return Result.Success(assetPath + ".meta");
diff --git a/Ghost.Editor/Core/AppState/EditorState.cs b/Ghost.Editor/Core/AppState/EditorState.cs
index 4382619..662bbfc 100644
--- a/Ghost.Editor/Core/AppState/EditorState.cs
+++ b/Ghost.Editor/Core/AppState/EditorState.cs
@@ -4,7 +4,6 @@ using Ghost.Editor.Core.AssetHandle;
using Ghost.Editor.View.Windows;
using Ghost.Engine;
using Ghost.Engine.Services;
-using Ghost.Graphics;
using Microsoft.UI.Xaml.Media;
namespace Ghost.Editor.Core.AppState;
diff --git a/Ghost.Editor/View/Pages/EngineEditor/ScenePage.xaml.cs b/Ghost.Editor/View/Pages/EngineEditor/ScenePage.xaml.cs
index 4919d59..f83ab2d 100644
--- a/Ghost.Editor/View/Pages/EngineEditor/ScenePage.xaml.cs
+++ b/Ghost.Editor/View/Pages/EngineEditor/ScenePage.xaml.cs
@@ -1,5 +1,4 @@
using Ghost.Editor.Controls.Internal;
-using Ghost.Graphics;
using Ghost.Graphics.Contracts;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
diff --git a/Ghost.Engine/EngineCore.cs b/Ghost.Engine/EngineCore.cs
index fadca99..236d914 100644
--- a/Ghost.Engine/EngineCore.cs
+++ b/Ghost.Engine/EngineCore.cs
@@ -1,6 +1,5 @@
using Ghost.Engine.Models;
using Ghost.Engine.Services;
-using Ghost.Graphics;
namespace Ghost.Engine;
diff --git a/Ghost.Entities/Query/QueryFilter.cs b/Ghost.Entities/Query/QueryFilter.cs
index 5c57328..6b01cf0 100644
--- a/Ghost.Entities/Query/QueryFilter.cs
+++ b/Ghost.Entities/Query/QueryFilter.cs
@@ -1,5 +1,4 @@
using Ghost.Core;
-using Ghost.Entities.Components;
using Misaki.HighPerformance.LowLevel.Buffer;
using Misaki.HighPerformance.LowLevel.Collections;
diff --git a/Ghost.Entities/Template/ForEach.cs b/Ghost.Entities/Template/ForEach.cs
index 284f72c..34fb214 100644
--- a/Ghost.Entities/Template/ForEach.cs
+++ b/Ghost.Entities/Template/ForEach.cs
@@ -3,10 +3,10 @@
namespace Ghost.Entities;
public delegate void ForEach(ref T0 t0Component);
-public delegate void ForEach(ref T0 t0Component,ref T1 t1Component);
-public delegate void ForEach(ref T0 t0Component,ref T1 t1Component,ref T2 t2Component);
-public delegate void ForEach(ref T0 t0Component,ref T1 t1Component,ref T2 t2Component,ref T3 t3Component);
-public delegate void ForEach(ref T0 t0Component,ref T1 t1Component,ref T2 t2Component,ref T3 t3Component,ref T4 t4Component);
-public delegate void ForEach(ref T0 t0Component,ref T1 t1Component,ref T2 t2Component,ref T3 t3Component,ref T4 t4Component,ref T5 t5Component);
-public delegate void ForEach(ref T0 t0Component,ref T1 t1Component,ref T2 t2Component,ref T3 t3Component,ref T4 t4Component,ref T5 t5Component,ref T6 t6Component);
-public delegate void ForEach(ref T0 t0Component,ref T1 t1Component,ref T2 t2Component,ref T3 t3Component,ref T4 t4Component,ref T5 t5Component,ref T6 t6Component,ref T7 t7Component);
+public delegate void ForEach(ref T0 t0Component, ref T1 t1Component);
+public delegate void ForEach(ref T0 t0Component, ref T1 t1Component, ref T2 t2Component);
+public delegate void ForEach(ref T0 t0Component, ref T1 t1Component, ref T2 t2Component, ref T3 t3Component);
+public delegate void ForEach(ref T0 t0Component, ref T1 t1Component, ref T2 t2Component, ref T3 t3Component, ref T4 t4Component);
+public delegate void ForEach(ref T0 t0Component, ref T1 t1Component, ref T2 t2Component, ref T3 t3Component, ref T4 t4Component, ref T5 t5Component);
+public delegate void ForEach(ref T0 t0Component, ref T1 t1Component, ref T2 t2Component, ref T3 t3Component, ref T4 t4Component, ref T5 t5Component, ref T6 t6Component);
+public delegate void ForEach(ref T0 t0Component, ref T1 t1Component, ref T2 t2Component, ref T3 t3Component, ref T4 t4Component, ref T5 t5Component, ref T6 t6Component, ref T7 t7Component);
diff --git a/Ghost.Entities/Template/QueryEnumerable.cs b/Ghost.Entities/Template/QueryEnumerable.cs
index 8202e18..41fb40d 100644
--- a/Ghost.Entities/Template/QueryEnumerable.cs
+++ b/Ghost.Entities/Template/QueryEnumerable.cs
@@ -49,7 +49,7 @@ public unsafe ref struct QueryEnumerable
{
private ref QueryFilter _filter;
private UnsafeBitSet _filterMask;
-
+
private readonly ReadOnlySpan _entities;
private readonly Stack.Scope _stackScope;
@@ -102,101 +102,101 @@ public unsafe ref struct QueryEnumerable
}
}
- public QueryEnumerable WithAll()
- where TComponent0 : unmanaged, IComponentData
- {
+ public QueryEnumerable WithAll()
+ where TComponent0 : unmanaged, IComponentData
+ {
_filter._all.Add(TypeHandle.Get());
return this;
- }
+ }
public QueryEnumerable WithAny()
- where TComponent0 : unmanaged, IComponentData
- {
+ where TComponent0 : unmanaged, IComponentData
+ {
_filter._any.Add(TypeHandle.Get());
return this;
- }
+ }
public QueryEnumerable WithAbsent()
- where TComponent0 : unmanaged, IComponentData
- {
+ where TComponent0 : unmanaged, IComponentData
+ {
_filter._absent.Add(TypeHandle.Get());
return this;
- }
+ }
public QueryEnumerable WithDisabled()
- where TComponent0 : unmanaged, IComponentData
- {
+ where TComponent0 : unmanaged, IComponentData
+ {
_filter._disabled.Add(TypeHandle.Get());
return this;
- }
+ }
- public QueryEnumerable WithAll()
- where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData
- {
+ public QueryEnumerable WithAll()
+ where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData
+ {
_filter._all.Add(TypeHandle.Get());
_filter._all.Add(TypeHandle.Get());
return this;
- }
+ }
public QueryEnumerable WithAny()
- where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData
- {
+ where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData
+ {
_filter._any.Add(TypeHandle.Get());
_filter._any.Add(TypeHandle.Get());
return this;
- }
+ }
public QueryEnumerable WithAbsent()
- where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData
- {
+ where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData
+ {
_filter._absent.Add(TypeHandle.Get());
_filter._absent.Add(TypeHandle.Get());
return this;
- }
+ }
public QueryEnumerable WithDisabled()
- where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData
- {
+ where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData
+ {
_filter._disabled.Add(TypeHandle.Get());
_filter._disabled.Add(TypeHandle.Get());
return this;
- }
+ }
- public QueryEnumerable WithAll()
- where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData where TComponent2 : unmanaged, IComponentData
- {
+ public QueryEnumerable WithAll()
+ where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData where TComponent2 : unmanaged, IComponentData
+ {
_filter._all.Add(TypeHandle.Get());
_filter._all.Add(TypeHandle.Get());
_filter._all.Add(TypeHandle.Get());
return this;
- }
+ }
public QueryEnumerable WithAny()
- where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData where TComponent2 : unmanaged, IComponentData
- {
+ where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData where TComponent2 : unmanaged, IComponentData
+ {
_filter._any.Add(TypeHandle.Get());
_filter._any.Add(TypeHandle.Get());
_filter._any.Add(TypeHandle.Get());
return this;
- }
+ }
public QueryEnumerable WithAbsent()
- where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData where TComponent2 : unmanaged, IComponentData
- {
+ where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData where TComponent2 : unmanaged, IComponentData
+ {
_filter._absent.Add(TypeHandle.Get());
_filter._absent.Add(TypeHandle.Get());
_filter._absent.Add(TypeHandle.Get());
return this;
- }
+ }
public QueryEnumerable WithDisabled()
- where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData where TComponent2 : unmanaged, IComponentData
- {
+ where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData where TComponent2 : unmanaged, IComponentData
+ {
_filter._disabled.Add(TypeHandle.Get());
_filter._disabled.Add(TypeHandle.Get());
_filter._disabled.Add(TypeHandle.Get());
return this;
- }
+ }
}
public unsafe ref struct QueryEnumerable
@@ -244,7 +244,7 @@ public unsafe ref struct QueryEnumerable
{
private ref QueryFilter _filter;
private UnsafeBitSet _filterMask;
-
+
private readonly ReadOnlySpan _entities;
private readonly Stack.Scope _stackScope;
@@ -299,101 +299,101 @@ public unsafe ref struct QueryEnumerable
}
}
- public QueryEnumerable WithAll()
- where TComponent0 : unmanaged, IComponentData
- {
+ public QueryEnumerable WithAll()
+ where TComponent0 : unmanaged, IComponentData
+ {
_filter._all.Add(TypeHandle.Get());
return this;
- }
+ }
public QueryEnumerable WithAny()
- where TComponent0 : unmanaged, IComponentData
- {
+ where TComponent0 : unmanaged, IComponentData
+ {
_filter._any.Add(TypeHandle.Get());
return this;
- }
+ }
public QueryEnumerable WithAbsent()
- where TComponent0 : unmanaged, IComponentData
- {
+ where TComponent0 : unmanaged, IComponentData
+ {
_filter._absent.Add(TypeHandle.Get());
return this;
- }
+ }
public QueryEnumerable WithDisabled()
- where TComponent0 : unmanaged, IComponentData
- {
+ where TComponent0 : unmanaged, IComponentData
+ {
_filter._disabled.Add(TypeHandle.Get());
return this;
- }
+ }
- public QueryEnumerable WithAll()
- where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData
- {
+ public QueryEnumerable WithAll()
+ where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData
+ {
_filter._all.Add(TypeHandle.Get());
_filter._all.Add(TypeHandle.Get());
return this;
- }
+ }
public QueryEnumerable WithAny()
- where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData
- {
+ where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData
+ {
_filter._any.Add(TypeHandle.Get());
_filter._any.Add(TypeHandle.Get());
return this;
- }
+ }
public QueryEnumerable WithAbsent()
- where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData
- {
+ where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData
+ {
_filter._absent.Add(TypeHandle.Get());
_filter._absent.Add(TypeHandle.Get());
return this;
- }
+ }
public QueryEnumerable WithDisabled()
- where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData
- {
+ where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData
+ {
_filter._disabled.Add(TypeHandle.Get());
_filter._disabled.Add(TypeHandle.Get());
return this;
- }
+ }
- public QueryEnumerable WithAll()
- where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData where TComponent2 : unmanaged, IComponentData
- {
+ public QueryEnumerable WithAll()
+ where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData where TComponent2 : unmanaged, IComponentData
+ {
_filter._all.Add(TypeHandle.Get());
_filter._all.Add(TypeHandle.Get());
_filter._all.Add(TypeHandle.Get());
return this;
- }
+ }
public QueryEnumerable WithAny()
- where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData where TComponent2 : unmanaged, IComponentData
- {
+ where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData where TComponent2 : unmanaged, IComponentData
+ {
_filter._any.Add(TypeHandle.Get());
_filter._any.Add(TypeHandle.Get());
_filter._any.Add(TypeHandle.Get());
return this;
- }
+ }
public QueryEnumerable WithAbsent()
- where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData where TComponent2 : unmanaged, IComponentData
- {
+ where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData where TComponent2 : unmanaged, IComponentData
+ {
_filter._absent.Add(TypeHandle.Get());
_filter._absent.Add(TypeHandle.Get());
_filter._absent.Add(TypeHandle.Get());
return this;
- }
+ }
public QueryEnumerable WithDisabled()
- where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData where TComponent2 : unmanaged, IComponentData
- {
+ where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData where TComponent2 : unmanaged, IComponentData
+ {
_filter._disabled.Add(TypeHandle.Get());
_filter._disabled.Add(TypeHandle.Get());
_filter._disabled.Add(TypeHandle.Get());
return this;
- }
+ }
}
public unsafe ref struct QueryEnumerable
@@ -445,7 +445,7 @@ public unsafe ref struct QueryEnumerable
{
private ref QueryFilter _filter;
private UnsafeBitSet _filterMask;
-
+
private readonly ReadOnlySpan _entities;
private readonly Stack.Scope _stackScope;
@@ -502,101 +502,101 @@ public unsafe ref struct QueryEnumerable
}
}
- public QueryEnumerable WithAll()
- where TComponent0 : unmanaged, IComponentData
- {
+ public QueryEnumerable WithAll()
+ where TComponent0 : unmanaged, IComponentData
+ {
_filter._all.Add(TypeHandle.Get());
return this;
- }
+ }
public QueryEnumerable WithAny()
- where TComponent0 : unmanaged, IComponentData
- {
+ where TComponent0 : unmanaged, IComponentData
+ {
_filter._any.Add(TypeHandle.Get());
return this;
- }
+ }
public QueryEnumerable WithAbsent()
- where TComponent0 : unmanaged, IComponentData
- {
+ where TComponent0 : unmanaged, IComponentData
+ {
_filter._absent.Add(TypeHandle.Get());
return this;
- }
+ }
public QueryEnumerable WithDisabled()
- where TComponent0 : unmanaged, IComponentData
- {
+ where TComponent0 : unmanaged, IComponentData
+ {
_filter._disabled.Add(TypeHandle.Get());
return this;
- }
+ }
- public QueryEnumerable WithAll()
- where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData
- {
+ public QueryEnumerable WithAll()
+ where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData
+ {
_filter._all.Add(TypeHandle.Get());
_filter._all.Add(TypeHandle.Get());
return this;
- }
+ }
public QueryEnumerable WithAny()
- where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData
- {
+ where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData
+ {
_filter._any.Add(TypeHandle.Get());
_filter._any.Add(TypeHandle.Get());
return this;
- }
+ }
public QueryEnumerable WithAbsent()
- where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData
- {
+ where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData
+ {
_filter._absent.Add(TypeHandle.Get());
_filter._absent.Add(TypeHandle.Get());
return this;
- }
+ }
public QueryEnumerable WithDisabled()
- where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData
- {
+ where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData
+ {
_filter._disabled.Add(TypeHandle.Get());
_filter._disabled.Add(TypeHandle.Get());
return this;
- }
+ }
- public QueryEnumerable WithAll()
- where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData where TComponent2 : unmanaged, IComponentData
- {
+ public QueryEnumerable WithAll()
+ where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData where TComponent2 : unmanaged, IComponentData
+ {
_filter._all.Add(TypeHandle.Get());
_filter._all.Add(TypeHandle.Get());
_filter._all.Add(TypeHandle.Get());
return this;
- }
+ }
public QueryEnumerable WithAny()
- where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData where TComponent2 : unmanaged, IComponentData
- {
+ where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData where TComponent2 : unmanaged, IComponentData
+ {
_filter._any.Add(TypeHandle.Get());
_filter._any.Add(TypeHandle.Get());
_filter._any.Add(TypeHandle.Get());
return this;
- }
+ }
public QueryEnumerable WithAbsent()
- where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData where TComponent2 : unmanaged, IComponentData
- {
+ where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData where TComponent2 : unmanaged, IComponentData
+ {
_filter._absent.Add(TypeHandle.Get());
_filter._absent.Add(TypeHandle.Get());
_filter._absent.Add(TypeHandle.Get());
return this;
- }
+ }
public QueryEnumerable WithDisabled()
- where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData where TComponent2 : unmanaged, IComponentData
- {
+ where TComponent0 : unmanaged, IComponentData where TComponent1 : unmanaged, IComponentData where TComponent2 : unmanaged, IComponentData
+ {
_filter._disabled.Add(TypeHandle.Get());
_filter._disabled.Add(TypeHandle.Get());
_filter._disabled.Add(TypeHandle.Get());
return this;
- }
+ }
}
public unsafe ref struct QueryEnumerable
@@ -652,7 +652,7 @@ public unsafe ref struct QueryEnumerable
{
private ref QueryFilter _filter;
private UnsafeBitSet _filterMask;
-
+
private readonly ReadOnlySpan _entities;
private readonly Stack.Scope _stackScope;
@@ -711,101 +711,101 @@ public unsafe ref struct QueryEnumerable
}
}
- public QueryEnumerable WithAll()
- where TComponent0 : unmanaged, IComponentData
- {
+ public QueryEnumerable WithAll()
+ where TComponent0 : unmanaged, IComponentData
+ {
_filter._all.Add(TypeHandle.Get());
return this;
- }
+ }
public QueryEnumerable WithAny()
- where TComponent0 : unmanaged, IComponentData
- {
+ where TComponent0 : unmanaged, IComponentData
+ {
_filter._any.Add(TypeHandle.Get());
return this;
- }
+ }
public QueryEnumerable WithAbsent()
- where TComponent0 : unmanaged, IComponentData
- {
+ where TComponent0 : unmanaged, IComponentData
+ {
_filter._absent.Add(TypeHandle.Get());
return this;
- }
+ }
public QueryEnumerable WithDisabled()
- where TComponent0 : unmanaged, IComponentData
- {
+ where TComponent0 : unmanaged, IComponentData
+ {
_filter._disabled.Add(TypeHandle.Get());
return this;
- }
+ }
- public QueryEnumerable WithAll