Skip to content
Hibzz.Docs

Sequence

The Sequence operation is a core Operation part of the Dropl package that allows the developers to string together multiple Operations in a sequence. This is useful for creating a series of Operations that need to be executed in a specific order.

Usage

To create a new chain of Operations, simply create a new Sequence object and start adding Operations to it using the Add function. Once all of the Operations have been added, the Sequence can be executed by adding it an Executer or by calling the AddToDefaultExecuter function.

// Create a new Sequence
Sequence sequence = new Sequence();

// add Operations to the Sequence
sequence.Add(exampleOperation1);
sequence.Add(exampleOperation2);
sequence.Add(exampleOperation3);

// Add the Sequence to the default Executer
sequence.AddToDefaultExecuter();

When removing Operations from an Executer, the base Remove function will not remove the Operations nested inside of the Sequence. To remove the Operations from deep inside of the Sequence, use the RemoveAll function.

API Reference

Methods

public void Add(Operation operation)

Adds the given Operation to the Sequence at the end of the list so that it’ll be executed later when all other Operations in the queue have been dispersed.

public void Remove(Operation operation)

Removes the given Operation from the Sequence if it exists. This function doesn’t work recursively and if the Operation is nested inside of another Sequence, it won’t be removed.

public void RemoveAll(Operation operation)]

Removes all instances of the given Operation from the Sequence, including any instances that are nested inside of the child Sequences.

public void Remove(Filter filter)

Removes all Operations from the Sequence that match the given Filter. This function doesn’t work recursively and if the Filter matches an Operation that is nested inside of another Sequence, it won’t be removed.

public void RemoveAll(Filter filter)

Removes all Operations from the Sequence that match the given Filter, including any instances that are nested inside of the child Sequences.