DeltaECS.Generators 0.0.48

dotnet add package DeltaECS.Generators --version 0.0.48
                    
NuGet\Install-Package DeltaECS.Generators -Version 0.0.48
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DeltaECS.Generators" Version="0.0.48">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DeltaECS.Generators" Version="0.0.48" />
                    
Directory.Packages.props
<PackageReference Include="DeltaECS.Generators">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DeltaECS.Generators --version 0.0.48
                    
#r "nuget: DeltaECS.Generators, 0.0.48"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DeltaECS.Generators@0.0.48
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DeltaECS.Generators&version=0.0.48
                    
Install as a Cake Addin
#tool nuget:?package=DeltaECS.Generators&version=0.0.48
                    
Install as a Cake Tool

DeltaECS.Generators

DeltaECS.Generators is a build-time Roslyn analyzer/source generator for consumer callback shapes and component registration. It is packaged as an analyzer and has no runtime dependency on the generator assembly.

<PackageReference Include="DeltaECS" Version="*" />
<PackageReference Include="DeltaECS.Generators" Version="*"
                  PrivateAssets="all" />

The package places its analyzer assembly under analyzers/dotnet/cs. It generates consumer-side ForEach/ForEachEntity callback forms, query-wide Where predicate terminals, generic primary-component structural façades for Create/Add/Remove (including multi-value Add calls), and typed World query factories on demand. Runtime ComponentId query factories are provided by DeltaECS; storage and runtime execution remain there as well.

Query combatants = world
    .WhereAll<Position, Health, Human>()
    .WhereNone<Dead, Escaped>()
    .WhereAny<Armed, Berserk>();

Typed WhereAll, WhereNone, and WhereAny are generated for both World and Query. The ComponentId query factories are runtime overloads that accept a ReadOnlySpan<ComponentId>; pass a span (or array) as one argument on older C# versions. C# 13 and later can also use expanded positional arguments. Generated iteration callbacks accept explicit ComponentId selectors positionally, one ID per component row. The first query call creates a query; each following call composes another filter and returns a new query handle while reusing the world's existing query-plan cache.

ReadOnlySpan<ComponentId> required = stackalloc ComponentId[] { positionId, velocityId };
Query bySpan = world.WhereAll(required);
Query byExpandedParams = world.WhereAll(positionId, velocityId); // C# 13+
Query byTypes = world.WhereAll<Position, Velocity>();

world.ForEach<Position, Velocity>(in byTypes, positionId, velocityId,
    static (ref Position position, in Velocity velocity) =>
        position.X += velocity.X);

The generator targets netstandard2.0 and is shipped from analyzers/dotnet/cs. Its target is independent from the target framework of the consumer project.

For Unity component authoring, DeltaECS.Generators also derives schema IDs for types marked with Delta.ECS.DeltaEcsComponentAttribute and generates strongly typed registration factories. DeltaECS.Unity uses these factories to register components without enumerating every type in loaded assemblies. A name-derived ID is stable for a given metadata name; set a non-zero SchemaId explicitly when the identity must survive component renames. The analyzer reports the current value so it can be copied into the attribute as an explicit SchemaId, and reports explicit zero IDs. The generator reports duplicate IDs within the consumer compilation; the Unity registry also checks for collisions when it combines catalogs from loaded assemblies.

Where functors implement IWherePredicate. Use Where for component-only predicates and WhereEntity when the predicate also needs the current entity. Terminal functors reuse the regular IForEach* contracts, including their ref context forms. See the generator API guide for complete syntax and interceptor configuration.

The generator is compiled against Microsoft.CodeAnalysis.CSharp 4.3.0, which is the Roslyn version required by Unity 6 source-generator projects. On newer Roslyn hosts the optional interceptor path is detected dynamically; Unity/C# 9 consumers use the ordinary generated path.

Consumers using C# 9 or C# 10, including Unity projects with a netstandard2.1 API profile, automatically use ordinary generated ForEach overloads. Interceptor source is emitted only when the consumer language version can parse the required interceptor declarations.

For the optional interceptor path, configure the consumer project as described in the generator documentation.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.48 0 10/10/2026
0.0.47 0 10/10/2026
0.0.46 41 10/9/2026
0.0.45 40 10/9/2026
0.0.44 36 10/9/2026
0.0.43 46 10/8/2026
0.0.42 40 10/8/2026
0.0.41 94 10/5/2026
0.0.40 86 10/4/2026
0.0.39 86 10/4/2026
0.0.38 82 10/3/2026
0.0.37 89 10/3/2026
0.0.36 88 10/2/2026
0.0.35 94 10/2/2026
0.0.34 81 10/2/2026
0.0.33 99 9/30/2026
0.0.32 95 9/22/2026
0.0.31 104 9/16/2026
0.0.30 93 9/15/2026
0.0.29 107 9/15/2026
Loading failed