Drive entity visibility from daemon contacts

This commit is contained in:
Meta Vens 2026-06-21 16:02:03 +01:00
commit 298dda56b3
4 changed files with 143 additions and 23 deletions

View file

@ -1027,6 +1027,62 @@ public class DaemonRuntimeDocumentTests
Assert.IsTrue(markers[0].Hostile);
}
[Test]
public void DaemonRenderQueriesPublishVisibleEntityIndicesFromObserverContacts()
{
var zone = new AetheriaRuntimeZoneSnapshotCommit
{
Entities = new[]
{
new AetheriaRuntimeEntitySnapshotCommit
{
EntityIndex = 10,
Contacts = new[]
{
new AetheriaRuntimeEntityContactCommit
{
TargetEntityIndex = 11,
InfoGathered = 0.7,
Visible = true
},
new AetheriaRuntimeEntityContactCommit
{
TargetEntityIndex = 12,
InfoGathered = 0.3,
Visible = true
},
new AetheriaRuntimeEntityContactCommit
{
TargetEntityIndex = 13,
InfoGathered = 0.9,
Visible = false
},
new AetheriaRuntimeEntityContactCommit
{
TargetEntityIndex = 99,
InfoGathered = 0.9,
Visible = true
}
}
},
new AetheriaRuntimeEntitySnapshotCommit { EntityIndex = 11 },
new AetheriaRuntimeEntitySnapshotCommit { EntityIndex = 12 },
new AetheriaRuntimeEntitySnapshotCommit { EntityIndex = 13 }
}
};
var visible = new List<int>();
var count = AetheriaRuntimeDaemonRenderQueries.QueryVisibleEntityIndices(
zone,
10,
0.5,
visible);
Assert.AreEqual(2, count);
Assert.AreEqual(10, visible[0]);
Assert.AreEqual(11, visible[1]);
}
[Test]
public void SoaViewIndexRejectsInvalidRenderGroups()
{