Skip to content

Commit

Permalink
Fixes to project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
thygrrr committed Nov 14, 2024
1 parent 9760495 commit 0124f79
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 1 deletion.
1 change: 1 addition & 0 deletions fennecs.benchmarks/fennecs.benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Numerics.Tensors" Version="9.0.0" PrivateAssets="All"/>
<PackageReference Include="BenchmarkDotNet" Version="0.14.1-nightly.20241107.194"/>
</ItemGroup>
</Project>
37 changes: 37 additions & 0 deletions fennecs.tests/Stream/Stream.3.Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,43 @@ [Fact] public void Can_Use_RWR_Inferred()
}


[Fact] public void Can_Use_ERWR_Inferred()
{
using var world = new World();
var entity = world.Spawn();
entity.Add(123).Add(890f).Add("ramen");

var stream = world.Stream<int, float, string>();

stream.For(static (e, a, b, s) =>
{
Assert.Equal(123, a.read);
Assert.Equal(890f, b.read);
b.write = 456f;
s.write = e.ToString();
});

}


[Fact] public void Can_Use_RW_Inferred()
{
using var world = new World();
var entity = world.Spawn();
entity.Add(123).Add(890f).Add("ramen");

var stream = world.Stream<int, float>();

stream.For(static (a, b) =>
{
Assert.Equal(123, a.read);
Assert.Equal(890f, b.read);
b.write = 456f;
});

}


[Fact]
public void Can_Enumerate_Stream()
{
Expand Down
2 changes: 1 addition & 1 deletion fennecs/Workloads.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ internal class Work<C1> : IThreadPoolWorkItem
public CountdownEvent CountDown = null!;


public void Execute()
public void Execute()
{
foreach (ref var c in Memory1.Span) Action(ref c);
CountDown.Signal();
Expand Down
1 change: 1 addition & 0 deletions fennecs/fennecs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@

<ItemGroup>
<PackageReference Include="CodegenCS.MSBuild" Version="3.5.2" PrivateAssets="All"/>
<PackageReference Include="System.Numerics.Tensors" Version="9.0.0" PrivateAssets="All"/>
</ItemGroup>

</Project>
3 changes: 3 additions & 0 deletions fennecs/storage/EntityRef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,7 @@ public readonly ref struct EntityRef(ref readonly Entity entity) : IEntity

/// <inheritdoc cref="Entity.Despawn"/>
public void Despawn() => _entity.Despawn();

/// <inheritdoc />
public override string ToString() => _entity.ToString();
}

0 comments on commit 0124f79

Please sign in to comment.