Struct EnqueuedEvent<TEvent, TPoint, TPointDelta>
- Namespace
- LfrlAnvil.Reactive.Queues.Composites
- Assembly
- LfrlAnvil.Reactive.Queues.dll
Represents an event enqueued in the IEventQueue<TEvent, TPoint, TPointDelta>.
public readonly struct EnqueuedEvent<TEvent, TPoint, TPointDelta>
Type Parameters
TEvent
Event type.
TPoint
Queue point type.
TPointDelta
Queue point delta type.
- Inherited Members
Properties
Delta
Point delta used for moving DequeuePoint forward on each repetition of this event.
public TPointDelta? Delta { get; }
Property Value
- TPointDelta
DequeuePoint
Queue point at which this event should be dequeued.
public TPoint DequeuePoint { get; }
Property Value
- TPoint
Event
Underlying event.
public TEvent Event { get; }
Property Value
- TEvent
IsInfinite
Specifies whether or not this event repeats infinitely.
public bool IsInfinite { get; }
Property Value
Repetitions
Number of repetitions of this event.
public int Repetitions { get; }
Property Value
Methods
AsInfinite()
Creates a new EnqueuedEvent<TEvent, TPoint, TPointDelta> instance that repeats infinitely.
[Pure]
public EnqueuedEvent<TEvent, TPoint, TPointDelta> AsInfinite()
Returns
- EnqueuedEvent<TEvent, TPoint, TPointDelta>
New EnqueuedEvent<TEvent, TPoint, TPointDelta> instance.
Create(TEvent, TPoint, TPointDelta, int)
Creates a new EnqueuedEvent<TEvent, TPoint, TPointDelta> instance that repeats specified number of times.
[Pure]
public static EnqueuedEvent<TEvent, TPoint, TPointDelta> Create(TEvent @event, TPoint dequeuePoint, TPointDelta delta, int repetitions)
Parameters
event
TEventUnderlying event.
dequeuePoint
TPointQueue point at which this event should be dequeued for the first time.
delta
TPointDeltaPoint delta used for moving DequeuePoint forward on each repetition of this event.
repetitions
intNumber of repetitions.
Returns
- EnqueuedEvent<TEvent, TPoint, TPointDelta>
New EnqueuedEvent<TEvent, TPoint, TPointDelta> instance.
Exceptions
- ArgumentOutOfRangeException
When
repetitions
is less than 1.
CreateInfinite(TEvent, TPoint, TPointDelta)
Creates a new EnqueuedEvent<TEvent, TPoint, TPointDelta> instance that repeats infinitely.
[Pure]
public static EnqueuedEvent<TEvent, TPoint, TPointDelta> CreateInfinite(TEvent @event, TPoint dequeuePoint, TPointDelta delta)
Parameters
event
TEventUnderlying event.
dequeuePoint
TPointQueue point at which this event should be dequeued for the first time.
delta
TPointDeltaPoint delta used for moving DequeuePoint forward on each repetition of this event.
Returns
- EnqueuedEvent<TEvent, TPoint, TPointDelta>
New EnqueuedEvent<TEvent, TPoint, TPointDelta> instance.
CreateSingle(TEvent, TPoint)
Creates a new EnqueuedEvent<TEvent, TPoint, TPointDelta> instance that happens exactly once.
[Pure]
public static EnqueuedEvent<TEvent, TPoint, TPointDelta> CreateSingle(TEvent @event, TPoint dequeuePoint)
Parameters
event
TEventUnderlying event.
dequeuePoint
TPointQueue point at which this event should be dequeued.
Returns
- EnqueuedEvent<TEvent, TPoint, TPointDelta>
New EnqueuedEvent<TEvent, TPoint, TPointDelta> instance.
ToString()
Returns a string representation of this EnqueuedEvent<TEvent, TPoint, TPointDelta> instance.
[Pure]
public override string ToString()
Returns
- string
String representation.
WithDelta(TPointDelta)
Creates a new EnqueuedEvent<TEvent, TPoint, TPointDelta> instance with changed Delta.
[Pure]
public EnqueuedEvent<TEvent, TPoint, TPointDelta> WithDelta(TPointDelta delta)
Parameters
delta
TPointDeltaPoint delta used for moving DequeuePoint forward on each repetition of this event.
Returns
- EnqueuedEvent<TEvent, TPoint, TPointDelta>
New EnqueuedEvent<TEvent, TPoint, TPointDelta> instance.
WithDequeuePoint(TPoint)
Creates a new EnqueuedEvent<TEvent, TPoint, TPointDelta> instance with changed DequeuePoint.
[Pure]
public EnqueuedEvent<TEvent, TPoint, TPointDelta> WithDequeuePoint(TPoint dequeuePoint)
Parameters
dequeuePoint
TPointNext queue point at which this event should be dequeued.
Returns
- EnqueuedEvent<TEvent, TPoint, TPointDelta>
New EnqueuedEvent<TEvent, TPoint, TPointDelta> instance.
WithRepetitions(int)
Creates a new EnqueuedEvent<TEvent, TPoint, TPointDelta> instance with changed Repetitions.
[Pure]
public EnqueuedEvent<TEvent, TPoint, TPointDelta> WithRepetitions(int repetitions)
Parameters
repetitions
intNumber of repetitions.
Returns
- EnqueuedEvent<TEvent, TPoint, TPointDelta>
New EnqueuedEvent<TEvent, TPoint, TPointDelta> instance.
Exceptions
- ArgumentOutOfRangeException
When
repetitions
is less than 1.