private NetworkObjectVisibilityChangeEventPayload BuildPayload([NotNull] IReadonlyInterestCollection interestCollection) { if (interestCollection == null) { throw new ArgumentNullException(nameof(interestCollection)); } //TODO: Provide movement mappable InterestChangedPacketBuilder changedPacketBuilder = new InterestChangedPacketBuilder(MovementDataMappable, EntityDataMapper, FieldUpdateFactory); //We delegate the packet building to the packet builder. But we still need to send it. //Sending is async so it can be fired off and not awaited, we won't want to await it NetworkObjectVisibilityChangeEventPayload changeEventPayload = changedPacketBuilder.Build(interestCollection.QueuedJoiningEntities, interestCollection.QueuedLeavingEntities); return(changeEventPayload); }
/// <inheritdoc /> public EntityVisibilityChangeContext([NotNull] NetworkEntityGuid entityGuid, [NotNull] IReadonlyInterestCollection interestCollection) { EntityGuid = entityGuid ?? throw new ArgumentNullException(nameof(entityGuid)); InterestCollection = interestCollection ?? throw new ArgumentNullException(nameof(interestCollection)); }