Zone.Entities read-only outside Zone: Admit and Remove are the only membership writers
Entities is a MemberView with no mutating member; Admit installs the death watch with the membership and refuses a member already present, Remove takes it away with the membership. The Reset and duplicate-Add bypass paths of the death watch cannot be spelled any more. Tests move to Admit/Remove; Admit also activates, so the explicit Activate calls that followed a raw Add are dropped. Unity call sites route through Zone.Remove. Builds: unverified at this commit (verified in the job at the head). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
38c2fcf6e4
commit
fa911f2d85
50 changed files with 206 additions and 320 deletions
|
|
@ -189,8 +189,7 @@ public sealed partial class FireControlCut124Tests
|
|||
var e = Build(TestSettings(), SolidShape(5, 4), hardpointArc: SolutionArc, weaponRange: 200f);
|
||||
var hull = e.Items.ItemData.RefOf<ItemData>(e.HullData);
|
||||
var decoy = new Ship(e.Items, e.Zone, new EquippableItem { Data = hull, Durability = 1000000, Lot = 400 }, new EntitySettings());
|
||||
e.Zone.Entities.Add(decoy);
|
||||
decoy.Activate();
|
||||
e.Zone.Admit(decoy, piloted: false);
|
||||
var at = radians(40f);
|
||||
decoy.Position = e.Shooter.Position + float3(sin(at), 0, cos(at)) * 100f;
|
||||
e.Shooter.VisibleEntities.Add(decoy);
|
||||
|
|
|
|||
Loading…
Reference in a new issue