Skip to content

Commit

Permalink
Arch.AOT.SourceGenerator 1.0.1 release and several bug fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
genaray committed Feb 16, 2024
1 parent ec35adc commit 999cf4b
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Arch.AOT.SourceGenerator/Arch.AOT.SourceGenerator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

<PackageId>Arch.AOT.SourceGenerator</PackageId>
<Title>Arch.AOT.SourceGenerator</Title>
<Version>1.0.0</Version>
<Version>1.0.1</Version>
<Authors>genaray</Authors>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<Description>A source generator for arch to support AOT. </Description>
<PackageReleaseNotes>Initial release.</PackageReleaseNotes>
<PackageReleaseNotes>Updated to Arch 1.7 and up. </PackageReleaseNotes>
<PackageTags>c#;.net;.net6;.net7;ecs;game;entity;gamedev; game-development; game-engine; entity-component-system; arch;</PackageTags>

<PackageProjectUrl>https://github.com/genaray/Arch.Extended</PackageProjectUrl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,9 @@ public static void Initialize()
/// <returns></returns>
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;
}
Expand Down
8 changes: 5 additions & 3 deletions Arch.Extended.Sample/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -30,7 +30,7 @@ public class Game : Microsoft.Xna.Framework.Game
private global::JobScheduler.JobScheduler _jobScheduler;

// Our systems processing entities
private Group<GameTime> _systems;
private System.Group<GameTime> _systems;
private DrawSystem _drawSystem;

// Monogame stuff
Expand Down Expand Up @@ -84,7 +84,7 @@ protected override void BeginRun()
_world = archSerializer.FromJson(worldJson);

// Create systems, running in order
_systems = new Group<GameTime>(
_systems = new System.Group<GameTime>(
"Systems",
new MovementSystem(_world, GraphicsDevice.Viewport.Bounds),
new ColorSystem(_world),
Expand All @@ -95,6 +95,8 @@ protected override void BeginRun()
// Initialize systems
_systems.Initialize();
_drawSystem.Initialize();

ComponentRegistry.Add(new ComponentType());
}

protected override void Update(GameTime gameTime)
Expand Down
2 changes: 1 addition & 1 deletion Arch.System/Arch.System.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<PackageId>Arch.System</PackageId>
<Title>Arch.System</Title>
<Version>1.0.4</Version>
<Version>1.0.5</Version>
<Authors>genaray</Authors>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<Description>A systems framework for arch.</Description>
Expand Down
2 changes: 1 addition & 1 deletion Arch.System/Systems.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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} }} }} ";
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 999cf4b

Please sign in to comment.