Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Commit 63e23c8

Browse files
committed
feat: Add GameObjectSyncSystemBase and update Arch dependencies
Add new GameObjectSyncSystemBase abstract system for syncing game objects with position data. Update all csproj files to use Arch-Events and Arch.System packages instead of the base Arch package.
1 parent ebae188 commit 63e23c8

4 files changed

Lines changed: 30 additions & 3 deletions

File tree

src/Lunar.Modules.TypeWriter.Test/Lunar.Modules.TypeWriter.Test.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12+
<PackageReference Include="Arch-Events" Version="2.1.0" />
13+
<PackageReference Include="Arch.System" Version="1.1.0" />
1214
<PackageReference Include="FluentAssertions" Version="8.5.0" />
1315
<PackageReference Include="JetBrains.Annotations" Version="2025.2.0" />
1416
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0"/>

src/Lunar.Modules.TypeWriter/Lunar.Modules.TypeWriter.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
<TargetFramework>netstandard2.1</TargetFramework>
66
<LangVersion>9</LangVersion>
77
</PropertyGroup>
8-
8+
99
<ItemGroup>
10-
<PackageReference Include="Arch" Version="2.1.0"/>
10+
<PackageReference Include="Arch-Events" Version="2.1.0" />
11+
<PackageReference Include="Arch.System" Version="1.1.0" />
1112
</ItemGroup>
1213

1314
</Project>

src/Lunar/Lunar.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Arch" Version="2.1.0"/>
11+
<PackageReference Include="Arch-Events" Version="2.1.0" />
12+
<PackageReference Include="Arch.System" Version="1.1.0" />
1213
</ItemGroup>
1314

1415
</Project>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using Arch.Core;
2+
using Arch.System;
3+
using Lunar.Components;
4+
5+
namespace Lunar.Systems
6+
{
7+
public abstract class GameObjectSyncSystemBase : BaseSystem<World, float>
8+
{
9+
protected GameObjectSyncSystemBase(World world) : base(world) { }
10+
11+
protected abstract void ApplyTransform(GameObjectComponent gameObject, PositionComponent position);
12+
13+
public override void Update(in float deltaTime)
14+
{
15+
var query = new QueryDescription().WithAll<GameObjectComponent, PositionComponent>();
16+
World.Query(in query,
17+
(Entity entity, ref GameObjectComponent gameObject, ref PositionComponent position) =>
18+
{
19+
ApplyTransform(gameObject, position);
20+
});
21+
}
22+
}
23+
}

0 commit comments

Comments
 (0)