#pragma once

#include "Transition.hpp"

/*
   Class: BlendTransition

     Implements a alpha blending transition that fades an alterable object in or out.

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

         Initializes the object.

       Parameters:

         pAlterableObject - Pointer to the alterable object to be altered.
         fAlpha - Change of alpha value.
         iTotalSteps - Duration of the transition in steps. Default value is <BLEND_STEPS>.
    */
    BlendTransition(AlterableObject* pAlterableObject, float fAlpha, int iTotalSteps = BLEND_STEPS);

    /*
       Destructor: ~BlendTransition

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


    /*
       Function: Update

         Updates the transition by executing one blending 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:
    AlterableObject* pAlterableObject;
    float fAlphaStep;
    int iTotalSteps;
    int iStepsDone;
};