#pragma once

#include "CompoundTransition.hpp"

/*
   Class: CompoundSequentialTransition

     Implements a sequential ordering transition using a queue to process the added child transitions sequentially.
     In contrast to the <AtomicSequentialTransition>, the compound sequential transition can also have compound transitions as child transitions.

     *Inherits* from <CompoundTransition>.
*/
class CompoundSequentialTransition: public CompoundTransition {
  public:
    /*
       Constructor: CompoundSequentialTransition

         Initializes the object.

       Parameters:

         pInitialChart - Pointer to the chart to be modified.
    */
    CompoundSequentialTransition(Chart* pInitialChart);

    /*
       Destructor: ~CompoundSequentialTransition

         Releases all allocated resources.
    */
    ~CompoundSequentialTransition();


    /*
       Function: Update

         Updates the first transition of the queue. If the transition is completed, it is removed. *Inherited* from <Transition>.
    */
    void Update();

    /*
       Function: Draw

         Draws the transition by drawing the active chart of the active transition. *Inherited* from <CompoundTransition>.

       Parameters:

         pPainter - The QPainter object that shall be used for painting.
    */
    void Draw(QPainter* pPainter);

    /*
       Function: Complete

         Checks if all child transitions are completed. *Inherited* from <Transition>.

       Returns:

         A boolean value indicating if all child transitions are completed.
    */
    bool Complete();

    /*
       Function: GetActiveChart

         Returns the active chart of the transition. This is the active chart of the active transition if present, else the initial chart. *Inherited* from <CompoundTransition>.

       Returns:

         Returns the active chart of the transition.
    */
    Chart* GetActiveChart();
};