diff --git a/Arch.AOT.SourceGenerator/Arch.AOT.SourceGenerator.csproj b/Arch.AOT.SourceGenerator/Arch.AOT.SourceGenerator.csproj index 2a525fb..6d4bb0f 100644 --- a/Arch.AOT.SourceGenerator/Arch.AOT.SourceGenerator.csproj +++ b/Arch.AOT.SourceGenerator/Arch.AOT.SourceGenerator.csproj @@ -13,11 +13,11 @@ Arch.AOT.SourceGenerator Arch.AOT.SourceGenerator - 1.0.0 + 1.0.1 genaray Apache-2.0 A source generator for arch to support AOT. - Initial release. + Updated to Arch 1.7 and up. c#;.net;.net6;.net7;ecs;game;entity;gamedev; game-development; game-engine; entity-component-system; arch; https://github.com/genaray/Arch.Extended diff --git a/Arch.AOT.SourceGenerator/Extensions/StringBuilderExtensions.cs b/Arch.AOT.SourceGenerator/Extensions/StringBuilderExtensions.cs index ff17e76..7fbac95 100644 --- a/Arch.AOT.SourceGenerator/Extensions/StringBuilderExtensions.cs +++ b/Arch.AOT.SourceGenerator/Extensions/StringBuilderExtensions.cs @@ -53,10 +53,9 @@ public static void Initialize() /// public static StringBuilder AppendComponentType(this StringBuilder sb, ref ComponentType componentType) { - var hasZeroFieldsString = componentType.IsZeroSize ? "true" : "false"; - var size = componentType.IsValueType ? $"Unsafe.SizeOf<{componentType.TypeName}>()" : "IntPtr.Size"; - - //sb.AppendLine($"ComponentRegistry.Add(new ComponentType(ComponentRegistry.Size + 1, typeof({componentType.TypeName}), {size}, {hasZeroFieldsString}));"); + //var size = componentType.IsValueType ? $"Unsafe.SizeOf<{componentType.TypeName}>()" : "IntPtr.Size"; + //sb.AppendLine($"ComponentRegistry.Add(typeof({componentType.TypeName}), new ComponentType(ComponentRegistry.Size + 1, {size}));"); + sb.AppendLine($"ArrayRegistry.Add<{componentType.TypeName}>();"); return sb; } diff --git a/Arch.Extended.Sample/Game.cs b/Arch.Extended.Sample/Game.cs index 47c905c..52670d2 100644 --- a/Arch.Extended.Sample/Game.cs +++ b/Arch.Extended.Sample/Game.cs @@ -6,9 +6,9 @@ using Arch.Core.Extensions; using Arch.Bus; using Arch.Core.Extensions.Dangerous; +using Arch.Core.Utils; using Arch.Persistence; using Arch.Relationships; -using Arch.System; using MessagePack; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -30,7 +30,7 @@ public class Game : Microsoft.Xna.Framework.Game private global::JobScheduler.JobScheduler _jobScheduler; // Our systems processing entities - private Group _systems; + private System.Group _systems; private DrawSystem _drawSystem; // Monogame stuff @@ -84,7 +84,7 @@ protected override void BeginRun() _world = archSerializer.FromJson(worldJson); // Create systems, running in order - _systems = new Group( + _systems = new System.Group( "Systems", new MovementSystem(_world, GraphicsDevice.Viewport.Bounds), new ColorSystem(_world), @@ -95,6 +95,8 @@ protected override void BeginRun() // Initialize systems _systems.Initialize(); _drawSystem.Initialize(); + + ComponentRegistry.Add(new ComponentType()); } protected override void Update(GameTime gameTime) diff --git a/Arch.System/Arch.System.csproj b/Arch.System/Arch.System.csproj index aa7ee9e..7394661 100644 --- a/Arch.System/Arch.System.csproj +++ b/Arch.System/Arch.System.csproj @@ -11,7 +11,7 @@ Arch.System Arch.System - 1.0.4 + 1.0.5 genaray Apache-2.0 A systems framework for arch. diff --git a/Arch.System/Systems.cs b/Arch.System/Systems.cs index 8360ad7..bdeec90 100644 --- a/Arch.System/Systems.cs +++ b/Arch.System/Systems.cs @@ -345,7 +345,7 @@ public override string ToString() stringBuilder.Length--; } - return $"Group = {{ {nameof(Name)} = {Name}, {nameof(_systems)} = {_systems} }} "; + return $"Group = {{ {nameof(Name)} = {Name}, Systems = {{ {stringBuilder} }} }} "; } /// diff --git a/README.md b/README.md index 5e664a0..bc8001b 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ dotnet add package Arch.EventBus --version 1.0.2 dotnet add package Arch.LowLevel --version 1.0.9 dotnet add package Arch.Relationships --version 1.0.0 dotnet add package Arch.Persistence --version 1.0.3 -dotnet add package Arch.AOT.SourceGenerator --version 1.0.0 +dotnet add package Arch.AOT.SourceGenerator --version 1.0.1 ``` # Features & Tools