Layout-aim: an identified hull shows where its mounts are; a located mount can be aimed at

TrySelectTargetItem and ResolvedTargetItem gate on FireControl.IsLocated (an item seen to act, or one on a mount of the
believed hull's layout) instead of IsRevealed; Combat keeps IsRevealed. Entity.LayoutOf derives the layout from the
Contact profile; SchematicRows appends a mount row per unclaimed hardpoint. A mount aim centres on the mount's cells and
is frozen per shot (PendingShot.AimAtMount). The cycle runs over located items, the schematic renders mount rows and
marks through SchematicRow.Marks. Not yet built or tested.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-15 00:17:14 +02:00
commit 095efacd79
5 changed files with 83 additions and 33 deletions

View file

@ -127,10 +127,13 @@ public readonly struct Reveal
// on the viewer's own ship, the live gear. `Claimed` is the class the row shows. The range label is the live range on
// the viewer's own ship and the claimed design's rated range on any other; a row whose claimed class is not a weapon has
// no range. The viewer never sees a target item's quality, wear or power. A renderer shows these and decides nothing.
// A mount row (`Mount` set, `Item` and `Claimed` null) is a hardpoint of the hull the viewer believes the ship to be, with
// nothing of the ship's claimed on it: where something is, not what.
public readonly struct SchematicRow
{
public readonly EquippedItem Item;
public readonly EquippableItemData Claimed;
public readonly HardpointData Mount;
private readonly bool _own;
internal SchematicRow(EquippedItem item, EquippableItemData claimed, bool own)
@ -140,12 +143,21 @@ public readonly struct SchematicRow
_own = own;
}
internal SchematicRow(HardpointData mount)
{
Mount = mount;
}
// What a renderer compares to know the rows changed. Range is a reading, not part of the key.
public (EquippedItem, EquippableItemData) Key => (Item, Claimed);
public (EquippedItem, EquippableItemData, HardpointData) Key => (Item, Claimed, Mount);
// Whether this row is the one `aimed` points at: a claimed-item row by its item, a mount row by the mount the aimed
// item sits on (an aimed item with a claimed-item row has no mount row).
public bool Marks(EquippedItem aimed) => Item != null ? Item == aimed : aimed != null && aimed.Hardpoint == Mount;
public float? Range => _own
? Item.Behaviors.OfType<Weapon>().First().Range
: Claimed.Behaviors.OfType<WeaponData>().FirstOrDefault()?.RatedRange;
: Claimed?.Behaviors.OfType<WeaponData>().FirstOrDefault()?.RatedRange;
}
// A subject's removal from a zone as the zone recorded it (death, dock, warp, any removal): where it was and how