Sequence

class Sequence : public Command

This Command that runs multiple Command s in a row.

Public Functions

inline Sequence(const std::initializer_list<Command*> commands)

Creates a new object that runs a series of commands one after another

Parameters:

commands – Initializer list for sequence Commands

inline virtual void initialize() override

Initializes the first command.

inline virtual void execute() override

Execute the current command, and step through when it’s done.

inline virtual bool isFinished() override

Finishes when the last command is finished

Returns:

Checks if it has completed the last command

inline virtual void end(const bool interrupted) override

Ends the correct Command when the Sequence is interrupted.

Parameters:

interrupted – End the last command if it was interrupted

inline virtual std::vector<Subsystem*> getRequirements() override

Returns the requirements the Sequence needs for each step.

Returns:

Returns a set of all the requirements of all the Commands in the sequence