Refactored `ArcEntityTest` to use updated `Transform` and `Mesh` components, improving query logic with `GetChunkIterator` and introducing `ForEach` methods for better modularity. Enhanced `Chunk` and `Archetype` structs with `readonly` properties and memory optimizations. Fixed bugs in memory copy logic and entity relocation. Improved `EntityManager` with proper disposal handling, added a destructor, and fixed pointer usage in `AddComponent` and `SetComponentData`. Refactored `EntityQuery` to use `ChunkIterator` and `ChunkView` for better abstraction. Simplified `EntityQueryMask` logic for performance. Introduced templated `ForEach` methods and `ForEachWithEntity` methods, dynamically generated using T4 templates for scalability. Added disposal logic for archetypes and queries in `World`. Updated `Program.cs` to include memory debugging setup. Integrated T4 templates for dynamic code generation and added helper functions for template generation. Updated project file to include templates and generated outputs. General improvements include enforcing immutability, optimizing memory management, and adding debugging/logging for better traceability.
24 lines
687 B
Plaintext
24 lines
687 B
Plaintext
<#@ template language="C#" #>
|
|
<#@ output extension="gen.cs" #>
|
|
<#@ assembly name="System.Core" #>
|
|
<#@ import namespace="System.Linq" #>
|
|
<#@ import namespace="System.Text" #>
|
|
<#@ include file="Helpers.ttinclude" #>
|
|
|
|
namespace Ghost.Entities;
|
|
|
|
<# for (var i = 1; i <= Amount; i++)
|
|
{
|
|
var generics = AppendGenerics(i);
|
|
var compGenerics = AppendGenericRefParameters(i);
|
|
#>
|
|
public delegate void ForEach<<#= generics #>>(<#= compGenerics #>);
|
|
<# } #>
|
|
|
|
<# for (var i = 1; i <= Amount; i++)
|
|
{
|
|
var generics = AppendGenerics(i);
|
|
var compGenerics = AppendGenericRefParameters(i);
|
|
#>
|
|
public delegate void ForEachWithEntity<<#= generics #>>(Entity entity, <#= compGenerics #>);
|
|
<# } #> |