/// <summary> /// Adds effect processor to container /// </summary> /// <param name="effectProcessor"></param> public void Add(IEffectProcessor <Effect> effectProcessor) { Effects.Add(effectProcessor.Effect); effectProcessor.CommitEffect(); this.Aggregate(Envelope, effectProcessor.Effect); if (effectProcessor.Effect.Account != 0) { AffectedAccounts.Add(effectProcessor.Effect.Account); } }
/// <summary> /// Sends envelope and all effects to specified callback /// </summary> /// <param name="buffer">Buffer to use for serialization</param> public void Complete(byte[] buffer) { var quantumModel = QuantumContainerExtensions.FromQuantumContainer( Envelope, Effects, AffectedAccounts.ToArray(), buffer); PendingDiffObject.Quanta.Add(quantumModel); PendingDiffObject.EffectsCount += Effects.Count; }