Aetheria/tests/Aetheria.Shared.Tests/EntityFormatTests.cs
Meta Vens f6c0d24dba One aim slot holds an item or a mount; the cycle covers every located mount
Entity.AimedAt (AimTarget: a revealed item or a believed mount) replaces
TargetItem. Two writers, TrySelectTargetItem (IsRevealed) and TrySelectMount
(in LayoutOf, not seen destroyed); ResolvedAim re-validates both on every read.
AimCycle is SchematicRows' enemy rows minus mounts in the observer's
seen-destroyed record, written only in Sense through PerceivesDestroyed.
SchematicRows drops its covering filter. IsLocated and AimsAtMount are deleted;
PendingShot.AimedMount and Silhouette's HardpointData mount replace the bool.
The cycle key calls Entity.CycleAim; the schematic marks read ResolvedAim.
Entity.ToString names an entity (follow-up entity-formats-safely).

The slot is AimedAt, not Aim: Entity.Aim is the pilot's pointing direction.
Not yet built or run; ActionGameManager and SchematicDisplay are uncompiled
without Unity.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 04:42:38 +02:00

27 lines
1.1 KiB
C#

using System.Linq;
using Xunit;
using Xunit.Sdk;
using static CultMath.math;
// follow-up entity-formats-safely: a failing assertion over an Entity reports it by name. xunit formats an object by walking
// its graph unless the object has a ToString, and an Entity's graph is the whole zone, which overflowed the test host on
// every failing Assert over an Entity.
public sealed partial class ContactRevealTests
{
[Fact]
public void EntityFormatsByName()
{
var bay = AddBay(float3(0, 0, 100), gun: true);
var other = Add(float3(0, 0, 0));
var entities = Assert.ThrowsAny<XunitException>(() => Assert.Same(bay, other));
Assert.Contains("Ship 'Bay'", entities.Message);
Assert.Contains("Ship 'Rack'", entities.Message);
Assert.True(entities.Message.Length < 2000, $"the message is {entities.Message.Length} characters");
var gun = Guns(bay).Single();
var reactor = Fitted(bay, "BayReactor");
var items = Assert.ThrowsAny<XunitException>(() => Assert.Same(gun, reactor));
Assert.True(items.Message.Length < 2000, $"the message is {items.Message.Length} characters");
}
}