From bcd2c2138e64fdbe46aeb59ee062cbc81bcb2751 Mon Sep 17 00:00:00 2001 From: Lars Date: Mon, 29 Apr 2024 22:44:43 +0200 Subject: [PATCH] New version. --- Arch.Extended.Sample/Arch.Extended.Sample.csproj | 2 +- Arch.Extended.Sample/Game.cs | 1 + Arch.Extended.Sample/Systems.cs | 4 ++-- Arch.Persistence/Arch.Persistence.csproj | 4 ++-- .../Arch.System.SourceGenerator.csproj | 9 ++++----- Arch.System.SourceGenerator/Query.cs | 4 +++- README.md | 4 ++-- 7 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Arch.Extended.Sample/Arch.Extended.Sample.csproj b/Arch.Extended.Sample/Arch.Extended.Sample.csproj index af9fe5f..454e1aa 100644 --- a/Arch.Extended.Sample/Arch.Extended.Sample.csproj +++ b/Arch.Extended.Sample/Arch.Extended.Sample.csproj @@ -19,7 +19,7 @@ - + diff --git a/Arch.Extended.Sample/Game.cs b/Arch.Extended.Sample/Game.cs index c9a6b95..6862e6b 100644 --- a/Arch.Extended.Sample/Game.cs +++ b/Arch.Extended.Sample/Game.cs @@ -76,6 +76,7 @@ protected override void BeginRun() StrictAllocationMode = false, } ); + World.SharedJobScheduler = _jobScheduler; // Spawn in entities with position, velocity and sprite for (var index = 0; index < 1000; index++) diff --git a/Arch.Extended.Sample/Systems.cs b/Arch.Extended.Sample/Systems.cs index e1ce179..f43e869 100644 --- a/Arch.Extended.Sample/Systems.cs +++ b/Arch.Extended.Sample/Systems.cs @@ -37,9 +37,9 @@ public partial class MovementSystem : BaseSystem /// The , passed by the "MoveQuery". /// The of the . Passed by the "MoveQuery". /// The of the . Passed by the "MoveQuery". - [Query] + [Query(Parallel = true)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Move([Data] GameTime time, ref Position pos, ref Velocity vel) + public static void Move([Data] GameTime time, ref Position pos, ref Velocity vel) { pos.Vector2 += time.ElapsedGameTime.Milliseconds * vel.Vector2; } diff --git a/Arch.Persistence/Arch.Persistence.csproj b/Arch.Persistence/Arch.Persistence.csproj index 8224bb0..7d171bf 100644 --- a/Arch.Persistence/Arch.Persistence.csproj +++ b/Arch.Persistence/Arch.Persistence.csproj @@ -18,8 +18,8 @@ https://github.com/genaray/Arch.Extended.git git c#;.net;.net6;.net7;ecs;game;entity;gamedev; game-development; game-engine; entity-component-system; arch; - Updated to Arch 1.2.7 - 1.0.3 + Updated to Arch 1.2.8 + 1.0.4 en-US true diff --git a/Arch.System.SourceGenerator/Arch.System.SourceGenerator.csproj b/Arch.System.SourceGenerator/Arch.System.SourceGenerator.csproj index e40f716..a0bd352 100644 --- a/Arch.System.SourceGenerator/Arch.System.SourceGenerator.csproj +++ b/Arch.System.SourceGenerator/Arch.System.SourceGenerator.csproj @@ -13,14 +13,13 @@ Arch.System.SourceGenerator Arch.System.SourceGenerator - 1.1.4 + 1.2.0 genaray Apache-2.0 A source generator for arch.system. - Data is now passed correctly into generated queries. -`@` in fromt of params is now accepted. -Added `World _world` to generated queries for making them usable in different worlds. - + Added #nullable enable to get rid of warnings. +Added @Query(Parallel = true) for generating parallel queries. +Some other small fixes. 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.System.SourceGenerator/Query.cs b/Arch.System.SourceGenerator/Query.cs index d22c814..7e87f6a 100644 --- a/Arch.System.SourceGenerator/Query.cs +++ b/Arch.System.SourceGenerator/Query.cs @@ -284,6 +284,7 @@ public static StringBuilder AppendQueryMethod(this StringBuilder sb, ref QueryMe var template = $$""" + #nullable enable using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -360,6 +361,7 @@ public static StringBuilder AppendParallelQueryMethod(this StringBuilder sb, ref var template = $$""" + #nullable enable using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -378,7 +380,7 @@ partial class {{queryMethod.ClassName}}{ Exclusive = {{exclusiveTypeArray}} }; - private {{staticModifier}} World? _{{queryMethod.MethodName}}_Initialized; + private {{staticModifier}} World _{{queryMethod.MethodName}}_Initialized; private {{staticModifier}} Query _{{queryMethod.MethodName}}_Query; [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/README.md b/README.md index 79c4c5f..58118ae 100644 --- a/README.md +++ b/README.md @@ -14,11 +14,11 @@ Extensions for [Arch](https://github.com/genaray/Arch) with some useful features Download the packages and get started today! ```console dotnet add package Arch.System --version 1.0.5 -dotnet add package Arch.System.SourceGenerator --version 1.1.4 +dotnet add package Arch.System.SourceGenerator --version 1.2.0 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.Persistence --version 1.0.4 dotnet add package Arch.AOT.SourceGenerator --version 1.0.1 ```