#pragma once

#include "Transition.hpp"
#include "MorphElement.hpp"

/*
   Class: MorphTransition

     Implements a morphing transition for morph elements. The morph transition morphs the initial morph object's shape to the desired result shape.

     *Inherits* from <Transition>.
*/
class MorphTransition: public Transition {
  public:
    /*
       Constructor: MorphTransition

         Initializes the object.

       Parameters:

         pInitialMorphElement - Pointer to the morph element to be morphed.
         pResultMorphElement - Pointer to the morph element whose shape shall be the result of the morphing process.
         iTotalSteps - Duration of the transition in steps.
    */
    MorphTransition(MorphElement* pInitialMorphElement,
      MorphElement* pResultMorphElement, int iTotalSteps);

    /*
       Destructor: ~MorphTransition

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


    /*
       Function: Update

         Updates the transition by executing one morphing step. *Inherited* from <Transition>.
    */
    void Update();

    /*
       Function: Complete

         Checks if the transition is completed. *Inherited* from <Transition>.

       Returns:

         A boolean value indicating if the transition is completed.
    */
    bool Complete();

  private:
    MorphElement* pInitialMorphElement;
    MorphElement* pResultMorphElement;
    glm::vec2* vMorphSteps;
    int iTotalSteps;
    int iStepsDone;
};