Add high-performance material/shader system (Ghost.Shader.Concept)
Introduces a new Ghost.Shader.Concept project implementing a modern, data-oriented material and shader system with: - Global/local keyword bitsets (fast O(1) ops, 64 bytes) - Multi-pass shader program and per-pass render state overrides - Thread-safe, 16-byte aligned material property blocks - Material pooling to reduce GC pressure - Batch renderer for efficient PSO grouping and async variant warmup - Full demo (Program.cs) and extensive documentation (ARCHITECTURE.md, README.md, PROJECT_SUMMARY.md) - Minor integration: new enums, doc updates, and keyword handling in existing code No breaking changes to the existing engine; all new code is isolated. This serves as a reference implementation for high-performance, extensible material/shader architectures.
This commit is contained in:
@@ -83,9 +83,9 @@ public struct ComponentSet : IDisposable, IEquatable<ComponentSet>
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Provides a unique identifier for the specified unmanaged component type.
|
||||
/// Provides a unique identifier for the specified unmanaged component space.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The component type for which to obtain an identifier. Must be unmanaged and implement <see cref="IComponent"/>.</typeparam>
|
||||
/// <typeparam name="T">The component space for which to obtain an identifier. Must be unmanaged and implement <see cref="IComponent"/>.</typeparam>
|
||||
public static class ComponentTypeID<T>
|
||||
where T : unmanaged, IComponent
|
||||
{
|
||||
@@ -122,7 +122,7 @@ internal static class ComponentRegistry
|
||||
size = sizeof(T),
|
||||
alignment = (int)MemoryUtility.AlignOf<T>(),
|
||||
isEnableable = typeof(IEnableableComponent).IsAssignableFrom(type),
|
||||
// isManaged = typeof(IManagedWrapper).IsAssignableFrom(type),
|
||||
// isManaged = typeof(IManagedWrapper).IsAssignableFrom(space),
|
||||
};
|
||||
|
||||
s_registeredComponents.Add(info);
|
||||
|
||||
@@ -73,9 +73,9 @@ public partial class EntityManager
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a ScriptComponent of type T to the given ManagedEntity and Entity.
|
||||
/// Adds a ScriptComponent of space T to the given ManagedEntity and Entity.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of ScriptComponent to add.</typeparam>
|
||||
/// <typeparam name="T">The space of ScriptComponent to add.</typeparam>
|
||||
/// <param name="managedEntity">The ManagedEntity to add the ScriptComponent to.</
|
||||
/// <param name="entity">The Entity associated with the ManagedEntity.</param>
|
||||
public void AddScriptComponent<T>(ManagedEntity managedEntity, Entity entity)
|
||||
@@ -100,9 +100,9 @@ public partial class EntityManager
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a ScriptComponent of type T to the given Entity.
|
||||
/// Adds a ScriptComponent of space T to the given Entity.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of ScriptComponent to add.</typeparam>
|
||||
/// <typeparam name="T">The space of ScriptComponent to add.</typeparam>
|
||||
/// <param name="entity">The Entity to add the ScriptComponent to.</param>
|
||||
public unsafe void AddScriptComponent<T>(Entity entity)
|
||||
where T : ScriptComponent, new()
|
||||
@@ -120,9 +120,9 @@ public partial class EntityManager
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Destroys the ScriptComponent of type T associated with the given ManagedEntity.
|
||||
/// Destroys the ScriptComponent of space T associated with the given ManagedEntity.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of ScriptComponent to destroy.</typeparam>
|
||||
/// <typeparam name="T">The space of ScriptComponent to destroy.</typeparam>
|
||||
/// <param name="managedEntity">The ManagedEntity whose ScriptComponent is to be destroyed </param>
|
||||
/// <returns>True if the ScriptComponent was found and destroyed, false otherwise.</returns
|
||||
public bool DestroyScriptComponent<T>(ManagedEntity managedEntity)
|
||||
@@ -147,11 +147,11 @@ public partial class EntityManager
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks if the given ManagedEntity has a ScriptComponent of type T.
|
||||
/// Checks if the given ManagedEntity has a ScriptComponent of space T.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of ScriptComponent to check for.</typeparam>
|
||||
/// <typeparam name="T">The space of ScriptComponent to check for.</typeparam>
|
||||
/// <param name="managedEntity">The ManagedEntity to check.</param>
|
||||
/// <returns>True if the ManagedEntity has a ScriptComponent of type T, false </returns>
|
||||
/// <returns>True if the ManagedEntity has a ScriptComponent of space T, false </returns>
|
||||
public bool HasScriptComponent<T>(ManagedEntity managedEntity)
|
||||
where T : ScriptComponent
|
||||
{
|
||||
@@ -172,11 +172,11 @@ public partial class EntityManager
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the ScriptComponent of type T associated with the given ManagedEntity.
|
||||
/// Gets the ScriptComponent of space T associated with the given ManagedEntity.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of ScriptComponent to get.</typeparam>
|
||||
/// <typeparam name="T">The space of ScriptComponent to get.</typeparam>
|
||||
/// <param name="managedEntity">The ManagedEntity whose ScriptComponent is to be retrieved
|
||||
/// <returns>The ScriptComponent of type T.</returns>
|
||||
/// <returns>The ScriptComponent of space T.</returns>
|
||||
public T GetScriptComponent<T>(ManagedEntity managedEntity)
|
||||
where T : ScriptComponent
|
||||
{
|
||||
@@ -197,11 +197,11 @@ public partial class EntityManager
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all ScriptComponents of type T associated with the given ManagedEntity.
|
||||
/// Gets all ScriptComponents of space T associated with the given ManagedEntity.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of ScriptComponent to get.</typeparam>
|
||||
/// <typeparam name="T">The space of ScriptComponent to get.</typeparam>
|
||||
/// <param name="managedEntity">The ManagedEntity whose ScriptComponents are to be retrieved
|
||||
/// <returns>The list of ScriptComponents of type T.</returns>
|
||||
/// <returns>The list of ScriptComponents of space T.</returns>
|
||||
public List<T> GetScriptComponents<T>(ManagedEntity managedEntity)
|
||||
where T : ScriptComponent
|
||||
{
|
||||
|
||||
@@ -100,7 +100,7 @@ public unsafe partial class EntityManager : IDisposable
|
||||
/// <summary>
|
||||
/// Create an entity with specified components.
|
||||
/// </summary>
|
||||
/// <param name="set">A set of component type IDs to add to the entities.</param>
|
||||
/// <param name="set">A set of component space IDs to add to the entities.</param>
|
||||
/// <returns>The created entity.</returns>
|
||||
public Entity CreateEntity(ComponentSet set)
|
||||
{
|
||||
@@ -162,7 +162,7 @@ public unsafe partial class EntityManager : IDisposable
|
||||
/// Create multiple entities with specified components.
|
||||
/// </summary>
|
||||
/// <param name="entities">The span to store the created entities.</param>
|
||||
/// <param name="set">A set of component type IDs to add to the entities.</param>
|
||||
/// <param name="set">A set of component space IDs to add to the entities.</param>
|
||||
/// <returns>An array of the created entities.</returns>
|
||||
public void CreateEntities(Span<Entity> entities, ComponentSet set)
|
||||
{
|
||||
@@ -198,7 +198,7 @@ public unsafe partial class EntityManager : IDisposable
|
||||
/// Create multiple entities with specified components.
|
||||
/// </summary>
|
||||
/// <param name="count">The number of entities to create.</param>
|
||||
/// <param name="set">A set of component type IDs to add to the entities.</param>
|
||||
/// <param name="set">A set of component space IDs to add to the entities.</param>
|
||||
public void CreateEntities(int count, ComponentSet set)
|
||||
{
|
||||
var hash = set.GetHashCode();
|
||||
@@ -380,7 +380,7 @@ public unsafe partial class EntityManager : IDisposable
|
||||
/// <summary>
|
||||
/// Create a singleton entity with the specified component.
|
||||
/// </summary>
|
||||
/// <param name="componentID">The component type ID of the singleton.</param>
|
||||
/// <param name="componentID">The component space ID of the singleton.</param>
|
||||
/// <param name="pComponent">Pointer to the component data.</param>
|
||||
/// <returns>The result status of the operation.</returns>
|
||||
public ErrorStatus CreateSingleton(Identifier<IComponent> componentID, void* pComponent)
|
||||
@@ -421,7 +421,7 @@ public unsafe partial class EntityManager : IDisposable
|
||||
/// <summary>
|
||||
/// Create a singleton entity with the specified component.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The component type.</typeparam>
|
||||
/// <typeparam name="T">The component space.</typeparam>
|
||||
/// <param name="component">The component data.</param>
|
||||
/// <returns>The result status of the operation.</returns>
|
||||
public ErrorStatus CreateSingleton<T>(T component = default)
|
||||
@@ -433,7 +433,7 @@ public unsafe partial class EntityManager : IDisposable
|
||||
/// <summary>
|
||||
/// Get a pointer to the singleton component data.
|
||||
/// </summary>
|
||||
/// <param name="componentID">The component type ID of the singleton.</param>
|
||||
/// <param name="componentID">The component space ID of the singleton.</param>
|
||||
/// <returns>Pointer to the component data, or null if not found.</returns>
|
||||
public void* GetSingleton(Identifier<IComponent> componentID)
|
||||
{
|
||||
@@ -461,7 +461,7 @@ public unsafe partial class EntityManager : IDisposable
|
||||
/// <summary>
|
||||
/// Get a reference to the singleton component data.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The component type.</typeparam>
|
||||
/// <typeparam name="T">The component space.</typeparam>
|
||||
/// <returns>Reference to the component data. null ref if not found.</returns>
|
||||
public ref T GetSingleton<T>()
|
||||
where T : unmanaged, IComponent
|
||||
@@ -473,7 +473,7 @@ public unsafe partial class EntityManager : IDisposable
|
||||
private static void CopyData(ref Archetype oldArch, int oldChunk, int oldRow,
|
||||
ref Archetype newArch, int newChunk, int newRow)
|
||||
{
|
||||
// Iterate every component type in the OLD archetype
|
||||
// Iterate every component space in the OLD archetype
|
||||
for (var i = 0; i < oldArch._layouts.Count; i++)
|
||||
{
|
||||
var layout = oldArch._layouts[i];
|
||||
@@ -497,7 +497,7 @@ public unsafe partial class EntityManager : IDisposable
|
||||
/// Add a component to the specified entity.
|
||||
/// </summary>
|
||||
/// <param name="entity">The entity to add the component to.</param>
|
||||
/// <param name="componentID">The component type ID to add.</param>
|
||||
/// <param name="componentID">The component space ID to add.</param>
|
||||
/// <param name="pComponent">Pointer to the component data.</param>
|
||||
/// <returns>The result status of the operation.</returns>
|
||||
public ErrorStatus AddComponent(Entity entity, Identifier<IComponent> componentID, void* pComponent)
|
||||
@@ -589,7 +589,7 @@ public unsafe partial class EntityManager : IDisposable
|
||||
/// <summary>
|
||||
/// Add a component to the specified entity.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The component type.</typeparam>
|
||||
/// <typeparam name="T">The component space.</typeparam>
|
||||
/// <param name="entity">The entity to add the component to.</param>
|
||||
/// <param name="component">The component data.</param>
|
||||
/// <returns>The result status of the operation.</returns>
|
||||
@@ -603,7 +603,7 @@ public unsafe partial class EntityManager : IDisposable
|
||||
/// Remove a component from the specified entity.
|
||||
/// </summary>
|
||||
/// <param name="entity">The entity to remove the component from.</param>
|
||||
/// <param name="componentID">The component type ID to remove.</param>
|
||||
/// <param name="componentID">The component space ID to remove.</param>
|
||||
/// <returns>The result status of the operation.</returns>
|
||||
public ErrorStatus RemoveComponent(Entity entity, Identifier<IComponent> componentID)
|
||||
{
|
||||
@@ -693,7 +693,7 @@ public unsafe partial class EntityManager : IDisposable
|
||||
/// <summary>
|
||||
/// Remove a component from the specified entity.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The component type.</typeparam>
|
||||
/// <typeparam name="T">The component space.</typeparam>
|
||||
/// <param name="entity">The entity to remove the component from.</param>
|
||||
/// <returns>The result status of the operation.</returns>
|
||||
public ErrorStatus RemoveComponent<T>(Entity entity)
|
||||
@@ -706,7 +706,7 @@ public unsafe partial class EntityManager : IDisposable
|
||||
/// Set the component data for the specified entity.
|
||||
/// </summary>
|
||||
/// <param name="entity">The entity to set the component data for.</param>
|
||||
/// <param name="componentID">The component type ID to set.</param>
|
||||
/// <param name="componentID">The component space ID to set.</param>
|
||||
/// <param name="pComponent">Pointer to the component data.</param>
|
||||
/// <returns>The result status of the operation.</returns>
|
||||
public ErrorStatus SetComponent(Entity entity, Identifier<IComponent> componentID, void* pComponent)
|
||||
@@ -725,7 +725,7 @@ public unsafe partial class EntityManager : IDisposable
|
||||
/// <summary>
|
||||
/// Set the component data for the specified entity.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The component type.</typeparam>
|
||||
/// <typeparam name="T">The component space.</typeparam>
|
||||
/// <param name="entity">The entity to set the component data for.</param>
|
||||
/// <param name="component">The component data.</param>
|
||||
public ErrorStatus SetComponent<T>(Entity entity, T component)
|
||||
@@ -738,7 +738,7 @@ public unsafe partial class EntityManager : IDisposable
|
||||
/// Get a pointer to the component data for the specified entity.
|
||||
/// </summary>
|
||||
/// <param name="entity">The entity to get the component data for.</param>
|
||||
/// <param name="componentID">The component type ID to get.</param>
|
||||
/// <param name="componentID">The component space ID to get.</param>
|
||||
/// <returns>Pointer to the component data, or null if not found.</returns>
|
||||
public void* GetComponent(Entity entity, Identifier<IComponent> componentID)
|
||||
{
|
||||
@@ -754,7 +754,7 @@ public unsafe partial class EntityManager : IDisposable
|
||||
/// <summary>
|
||||
/// Get a reference to the component data for the specified entity.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The component type.</typeparam>
|
||||
/// <typeparam name="T">The component space.</typeparam>
|
||||
/// <param name="entity">The entity to get the component data for.</param>
|
||||
/// <returns>Reference to the component data. null ref if not found.</returns>
|
||||
public ref T GetComponent<T>(Entity entity)
|
||||
@@ -768,7 +768,7 @@ public unsafe partial class EntityManager : IDisposable
|
||||
/// Check if the specified entity has the specified component.
|
||||
/// </summary>
|
||||
/// <param name="entity">The entity to check.</param>
|
||||
/// <param name="componentID">The component type ID to check.</param>
|
||||
/// <param name="componentID">The component space ID to check.</param>
|
||||
/// <returns>True if the entity has the component, false otherwise.</returns>
|
||||
public bool HasComponent(Entity entity, Identifier<IComponent> componentID)
|
||||
{
|
||||
@@ -784,7 +784,7 @@ public unsafe partial class EntityManager : IDisposable
|
||||
/// <summary>
|
||||
/// Check if the specified entity has the specified component.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The component type.</typeparam>
|
||||
/// <typeparam name="T">The component space.</typeparam>
|
||||
/// <param name="entity">The entity to check.</param>
|
||||
/// <returns>True if the entity has the component, false otherwise.</returns>
|
||||
public bool HasComponent<T>(Entity entity)
|
||||
@@ -797,7 +797,7 @@ public unsafe partial class EntityManager : IDisposable
|
||||
/// Set the enabled state of an enableable component for the specified entity.
|
||||
/// </summary>
|
||||
/// <param name="entity">The entity to set the enabled state for.</param>
|
||||
/// <param name="componentID">The component type ID of the enableable component.</
|
||||
/// <param name="componentID">The component space ID of the enableable component.</
|
||||
/// <param name="enabled">True to enable the component, false to disable it.</param>
|
||||
/// <returns>The result status of the operation.</returns>
|
||||
public ErrorStatus SetEnabled(Entity entity, Identifier<IComponent> componentID, bool enabled)
|
||||
@@ -839,7 +839,7 @@ public unsafe partial class EntityManager : IDisposable
|
||||
/// <summary>
|
||||
/// Set the enabled state of an enableable component for the specified entity.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The enableable component type.</typeparam>
|
||||
/// <typeparam name="T">The enableable component space.</typeparam>
|
||||
/// <param name="entity">The entity to set the enabled state for.</param>
|
||||
/// <param name="enabled">True to enable the component, false to disable it.</
|
||||
/// <returns>The result status of the operation.</returns>
|
||||
|
||||
@@ -135,12 +135,12 @@ public readonly unsafe ref struct ChunkView
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified version indicates that the component of type <typeparamref name="T"/> has
|
||||
/// Determines whether the specified version indicates that the component of space <typeparamref name="T"/> has
|
||||
/// changed since the last recorded version.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of component to check for changes. Must be an unmanaged type that implements <see cref="IComponent"/>.</typeparam>
|
||||
/// <typeparam name="T">The space of component to check for changes. Must be an unmanaged space that implements <see cref="IComponent"/>.</typeparam>
|
||||
/// <param name="version">The version number to compare against the current version of the component.</param>
|
||||
/// <returns>true if the component of type T has changed since the specified version; otherwise, false.</returns>
|
||||
/// <returns>true if the component of space T has changed since the specified version; otherwise, false.</returns>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public readonly bool HasChanged<T>(int version)
|
||||
where T : unmanaged, IComponent
|
||||
@@ -172,10 +172,10 @@ public readonly unsafe ref struct ChunkView
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current version number associated with the specified component type.
|
||||
/// Gets the current version number associated with the specified component space.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The component type for which to retrieve the version. Must be an unmanaged type that implements <see cref="IComponent"/>.</typeparam>
|
||||
/// <returns>The version number of the component type <typeparamref name="T"/>.</returns>
|
||||
/// <typeparam name="T">The component space for which to retrieve the version. Must be an unmanaged space that implements <see cref="IComponent"/>.</typeparam>
|
||||
/// <returns>The version number of the component space <typeparamref name="T"/>.</returns>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public readonly int GetComponentVersion<T>()
|
||||
where T : unmanaged, IComponent
|
||||
@@ -195,11 +195,11 @@ public readonly unsafe ref struct ChunkView
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly span providing direct access to the component data of type T0 for structuralAll entities in the chunk.
|
||||
/// Gets a readonly span providing direct access to the component data of space T0 for structuralAll entities in the chunk.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of component to access. Must be an unmanaged type that implements <see cref="Component"/>.</typeparam>
|
||||
/// <returns>A readonly span of type <see cref="{T}"/> containing the component data for each entity in the chunk.</returns>
|
||||
/// <exception cref="InvalidOperationException">Thrown if the specified component type is not present in the archetype.</exception>
|
||||
/// <typeparam name="T">The space of component to access. Must be an unmanaged space that implements <see cref="Component"/>.</typeparam>
|
||||
/// <returns>A readonly span of space <see cref="{T}"/> containing the component data for each entity in the chunk.</returns>
|
||||
/// <exception cref="InvalidOperationException">Thrown if the specified component space is not present in the archetype.</exception>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public ReadOnlySpan<T> GetComponentData<T>()
|
||||
where T : unmanaged, IComponent
|
||||
@@ -210,11 +210,11 @@ public readonly unsafe ref struct ChunkView
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a span providing direct access to the component data of type T0 for structuralAll entities in the chunk.
|
||||
/// Gets a span providing direct access to the component data of space T0 for structuralAll entities in the chunk.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of component to access. Must be an unmanaged type that implements <see cref="Component"/>.</typeparam>
|
||||
/// <returns>A span of type <see cref="{T}"/> containing the component data for each entity in the chunk.</returns>
|
||||
/// <exception cref="InvalidOperationException">Thrown if the specified component type is not present in the archetype.</exception>
|
||||
/// <typeparam name="T">The space of component to access. Must be an unmanaged space that implements <see cref="Component"/>.</typeparam>
|
||||
/// <returns>A span of space <see cref="{T}"/> containing the component data for each entity in the chunk.</returns>
|
||||
/// <exception cref="InvalidOperationException">Thrown if the specified component space is not present in the archetype.</exception>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public Span<T> GetComponentDataRW<T>()
|
||||
where T : unmanaged, IComponent
|
||||
@@ -230,11 +230,11 @@ public readonly unsafe ref struct ChunkView
|
||||
|
||||
/// <summary>
|
||||
/// Gets a bit set representing the enabled state of each instance of the specified enableable component
|
||||
/// type within the current chunk.
|
||||
/// space within the current chunk.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The component type for which to retrieve enablement bits. Must be unmanaged and implement <see cref="IEnableableComponent"/>.</typeparam>
|
||||
/// <returns>A <see cref="SpanBitSet"/> that provides access to the enablement bits for all instances of the specified component type in the chunk.</returns>
|
||||
/// <exception cref="InvalidOperationException">Thrown if the specified component type does not support enablement.</exception>
|
||||
/// <typeparam name="T">The component space for which to retrieve enablement bits. Must be unmanaged and implement <see cref="IEnableableComponent"/>.</typeparam>
|
||||
/// <returns>A <see cref="SpanBitSet"/> that provides access to the enablement bits for all instances of the specified component space in the chunk.</returns>
|
||||
/// <exception cref="InvalidOperationException">Thrown if the specified component space does not support enablement.</exception>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public SpanBitSet GetEnableBits<T>()
|
||||
where T : unmanaged, IEnableableComponent
|
||||
@@ -245,12 +245,12 @@ public readonly unsafe ref struct ChunkView
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified component of type <typeparamref name="T"/> at the given index is currently enabled.
|
||||
/// Determines whether the specified component of space <typeparamref name="T"/> at the given index is currently enabled.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the component to check. Must be an unmanaged type that implements <see cref="IEnableableComponent"/>.</typeparam>
|
||||
/// <typeparam name="T">The space of the component to check. Must be an unmanaged space that implements <see cref="IEnableableComponent"/>.</typeparam>
|
||||
/// <param name="index">The zero-based index of the component instance to check within the chunk.</param>
|
||||
/// <returns>true if the component at the specified index is enabled; otherwise, false.</returns>
|
||||
/// <exception cref="InvalidOperationException">Thrown if the specified component type <typeparamref name="T"/> does not support enable/disable functionality.</exception>
|
||||
/// <exception cref="InvalidOperationException">Thrown if the specified component space <typeparamref name="T"/> does not support enable/disable functionality.</exception>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool IsComponentEnabled<T>(int index)
|
||||
where T : unmanaged, IEnableableComponent
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Ghost.Entities;
|
||||
public ref partial struct QueryBuilder
|
||||
{
|
||||
/// <summary>
|
||||
/// Adds the specified component type(s) to the 'All' filter of the query.
|
||||
/// Adds the specified component space(s) to the 'All' filter of the query.
|
||||
/// Targets entities that have all of the specified component types and those component(s) must be enabled.
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -19,7 +19,7 @@ public ref partial struct QueryBuilder
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the specified component type(s) to the 'All' filter of the query and requires read-write access.
|
||||
/// Adds the specified component space(s) to the 'All' filter of the query and requires read-write access.
|
||||
/// Targets entities that have all of the specified component types and those component(s) must be enabled.
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -33,7 +33,7 @@ public ref partial struct QueryBuilder
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the specified component type(s) to the 'Any' filter of the query.
|
||||
/// Adds the specified component space(s) to the 'Any' filter of the query.
|
||||
/// Targets entities that have at least one of the specified component types and those component(s) must be enabled.
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -46,7 +46,7 @@ public ref partial struct QueryBuilder
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the specified component type(s) to the 'Absent' filter of the query.
|
||||
/// Adds the specified component space(s) to the 'Absent' filter of the query.
|
||||
/// Targets entities that do not have any of the specified component types.
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -59,7 +59,7 @@ public ref partial struct QueryBuilder
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the specified component type(s) to the 'None' filter of the query.
|
||||
/// Adds the specified component space(s) to the 'None' filter of the query.
|
||||
/// Targets entities that do not have any of the specified component types, or those component(s) are disabled.
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -72,7 +72,7 @@ public ref partial struct QueryBuilder
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the specified component type(s) to the 'Disabled' filter of the query.
|
||||
/// Adds the specified component space(s) to the 'Disabled' filter of the query.
|
||||
/// Targets entities that have all of the specified component types and those component(s) are disabled.
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -85,7 +85,7 @@ public ref partial struct QueryBuilder
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the specified component type(s) to the 'Present' filter of the query.
|
||||
/// Adds the specified component space(s) to the 'Present' filter of the query.
|
||||
/// Targets entities that have all of the specified component types, regardless of whether those component(s) are enabled or disabled.
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -98,7 +98,7 @@ public ref partial struct QueryBuilder
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the specified component type(s) to the 'Present' filter of the query and requires read-write access.
|
||||
/// Adds the specified component space(s) to the 'Present' filter of the query and requires read-write access.
|
||||
/// Targets entities that have all of the specified component types, regardless of whether those component(s) are enabled or disabled.
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -112,7 +112,7 @@ public ref partial struct QueryBuilder
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the specified component type(s) to the 'All' filter of the query.
|
||||
/// Adds the specified component space(s) to the 'All' filter of the query.
|
||||
/// Targets entities that have all of the specified component types and those component(s) must be enabled.
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -127,7 +127,7 @@ public ref partial struct QueryBuilder
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the specified component type(s) to the 'All' filter of the query and requires read-write access.
|
||||
/// Adds the specified component space(s) to the 'All' filter of the query and requires read-write access.
|
||||
/// Targets entities that have all of the specified component types and those component(s) must be enabled.
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -144,7 +144,7 @@ public ref partial struct QueryBuilder
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the specified component type(s) to the 'Any' filter of the query.
|
||||
/// Adds the specified component space(s) to the 'Any' filter of the query.
|
||||
/// Targets entities that have at least one of the specified component types and those component(s) must be enabled.
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -159,7 +159,7 @@ public ref partial struct QueryBuilder
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the specified component type(s) to the 'Absent' filter of the query.
|
||||
/// Adds the specified component space(s) to the 'Absent' filter of the query.
|
||||
/// Targets entities that do not have any of the specified component types.
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -174,7 +174,7 @@ public ref partial struct QueryBuilder
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the specified component type(s) to the 'None' filter of the query.
|
||||
/// Adds the specified component space(s) to the 'None' filter of the query.
|
||||
/// Targets entities that do not have any of the specified component types, or those component(s) are disabled.
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -189,7 +189,7 @@ public ref partial struct QueryBuilder
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the specified component type(s) to the 'Disabled' filter of the query.
|
||||
/// Adds the specified component space(s) to the 'Disabled' filter of the query.
|
||||
/// Targets entities that have all of the specified component types and those component(s) are disabled.
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -204,7 +204,7 @@ public ref partial struct QueryBuilder
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the specified component type(s) to the 'Present' filter of the query.
|
||||
/// Adds the specified component space(s) to the 'Present' filter of the query.
|
||||
/// Targets entities that have all of the specified component types, regardless of whether those component(s) are enabled or disabled.
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -219,7 +219,7 @@ public ref partial struct QueryBuilder
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the specified component type(s) to the 'Present' filter of the query and requires read-write access.
|
||||
/// Adds the specified component space(s) to the 'Present' filter of the query and requires read-write access.
|
||||
/// Targets entities that have all of the specified component types, regardless of whether those component(s) are enabled or disabled.
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -236,7 +236,7 @@ public ref partial struct QueryBuilder
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the specified component type(s) to the 'All' filter of the query.
|
||||
/// Adds the specified component space(s) to the 'All' filter of the query.
|
||||
/// Targets entities that have all of the specified component types and those component(s) must be enabled.
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -253,7 +253,7 @@ public ref partial struct QueryBuilder
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the specified component type(s) to the 'All' filter of the query and requires read-write access.
|
||||
/// Adds the specified component space(s) to the 'All' filter of the query and requires read-write access.
|
||||
/// Targets entities that have all of the specified component types and those component(s) must be enabled.
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -273,7 +273,7 @@ public ref partial struct QueryBuilder
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the specified component type(s) to the 'Any' filter of the query.
|
||||
/// Adds the specified component space(s) to the 'Any' filter of the query.
|
||||
/// Targets entities that have at least one of the specified component types and those component(s) must be enabled.
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -290,7 +290,7 @@ public ref partial struct QueryBuilder
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the specified component type(s) to the 'Absent' filter of the query.
|
||||
/// Adds the specified component space(s) to the 'Absent' filter of the query.
|
||||
/// Targets entities that do not have any of the specified component types.
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -307,7 +307,7 @@ public ref partial struct QueryBuilder
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the specified component type(s) to the 'None' filter of the query.
|
||||
/// Adds the specified component space(s) to the 'None' filter of the query.
|
||||
/// Targets entities that do not have any of the specified component types, or those component(s) are disabled.
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -324,7 +324,7 @@ public ref partial struct QueryBuilder
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the specified component type(s) to the 'Disabled' filter of the query.
|
||||
/// Adds the specified component space(s) to the 'Disabled' filter of the query.
|
||||
/// Targets entities that have all of the specified component types and those component(s) are disabled.
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -341,7 +341,7 @@ public ref partial struct QueryBuilder
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the specified component type(s) to the 'Present' filter of the query.
|
||||
/// Adds the specified component space(s) to the 'Present' filter of the query.
|
||||
/// Targets entities that have all of the specified component types, regardless of whether those component(s) are enabled or disabled.
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -358,7 +358,7 @@ public ref partial struct QueryBuilder
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the specified component type(s) to the 'Present' filter of the query and requires read-write access.
|
||||
/// Adds the specified component space(s) to the 'Present' filter of the query and requires read-write access.
|
||||
/// Targets entities that have all of the specified component types, regardless of whether those component(s) are enabled or disabled.
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
|
||||
Reference in New Issue
Block a user