public sealed class ExplicitInterestRuleVisibility a game has decided by hand, which nothing after it may argue with.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
The escape hatch every interest scheme needs and few have: a spectator who should see a player across the map, a quest marker that stays visible at any range, an object revealed by a scripted event, a teammate shown through walls.
⚠ It is a rule and a source, and it has to be both for any of those examples to work. This is where these remarks were a promise the type could not keep: they said "placed before the distance grid in the chain", and the grid is not in the chain's rule list at all — it is the IInterestSource ahead of every rule, so a rule is only ever asked about what the grid already decided to offer. Hiding therefore always worked and showing worked only for something that was in range anyway, which is to say for nothing anyone reaches for an override to do. Candidates is the other half: it nominates the entities this rule has been told to show, and InterestChain adds them to the candidates the source produced.
Keyed by NetworkId rather than by Entity, because an override is a decision about the object rather than about the row it currently occupies, and because it is the id a game has in hand when a rule fires. The entity handed to Show is a nomination rather than the key: it is checked against the id before it is offered, so a handle whose object has been destroyed and whose slot has been reused nominates nothing rather than the wrong thing.
Fields and properties (1)
public int PlayerCountHow many players have an override of any kind.
Methods (7)
public void Show(PlayerId player, Entity shown, NetworkId id)Shows an object to a player, whatever the source and the rest of the chain say.
public void Hide(PlayerId player, NetworkId id)Hides one from them whatever anything after this would say.
public bool Clear(PlayerId player, NetworkId id)Takes an override off, leaving the rest of the chain to decide.
public void Forget(PlayerId player)Forgets a player who has gone.
public void Forget(NetworkId id)Forgets an object that has been destroyed, for every player.
public Interest Decide(World world, PlayerId player, Entity entity)Decides, or declines to.
public void Candidates(World world, PlayerId player, List<Entity> into)Offers the objects this player has been told to see, wherever they are.
Used by (2)
- GameServerMultiplayer
- InterestTestsVixen.Net.Tests