Drive entity visibility from daemon contacts
This commit is contained in:
parent
9af4f4f2da
commit
298dda56b3
4 changed files with 143 additions and 23 deletions
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue