feat(core): UCG Stage 1 — ObjCell base + CellPortal
Introduces AcDream.Core.World.Cells namespace with the two foundational types for the Unified Cell Graph. CellPortal is a readonly struct unifying the three legacy portal representations; ObjCell is the abstract base for all traversable cells with the retail id-magnitude IsEnv discriminator (CObjCell::GetVisible, pseudo_c:308215). Zero consumers; zero behavior change. 5/5 tests green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
bd0244f203
commit
9cb15710be
3 changed files with 111 additions and 0 deletions
36
tests/AcDream.Core.Tests/World/Cells/ObjCellBaseTests.cs
Normal file
36
tests/AcDream.Core.Tests/World/Cells/ObjCellBaseTests.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
using System.Numerics;
|
||||
using AcDream.Core.World.Cells;
|
||||
using Xunit;
|
||||
|
||||
namespace AcDream.Core.Tests.World.Cells;
|
||||
|
||||
public class ObjCellBaseTests
|
||||
{
|
||||
private sealed class StubCell : ObjCell
|
||||
{
|
||||
public StubCell(uint id)
|
||||
: base(id, Matrix4x4.Identity, Matrix4x4.Identity,
|
||||
Vector3.Zero, Vector3.One,
|
||||
System.Array.Empty<CellPortal>(), System.Array.Empty<uint>(), false) { }
|
||||
public override bool PointInCell(Vector3 worldPoint) => false;
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0xA9B40174u, true)]
|
||||
[InlineData(0xA9B40005u, false)]
|
||||
[InlineData(0xA9B40100u, true)]
|
||||
[InlineData(0xA9B400FFu, false)]
|
||||
public void IsEnv_DispatchesByLow16Magnitude(uint id, bool expected)
|
||||
=> Assert.Equal(expected, new StubCell(id).IsEnv);
|
||||
|
||||
[Fact]
|
||||
public void Ctor_StoresBaseProperties()
|
||||
{
|
||||
var c = new StubCell(0xA9B40174u);
|
||||
Assert.Equal(0xA9B40174u, c.Id);
|
||||
Assert.Equal(Vector3.One, c.LocalBoundsMax);
|
||||
Assert.Empty(c.Portals);
|
||||
Assert.Empty(c.StabList);
|
||||
Assert.False(c.SeenOutside);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue