#pragma once

#include "Transition.hpp"

/*
   Class: MoveTransition

     Implements a transition that moves the specified data element by the given distances along the X and Y axes.

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

         Initializes the object.

       Parameters:

         pAlterableObject - Pointer to the alterable object to be altered.
         fDeltaLeft - Total horizontal distance.
         fDeltaTop - Total vertical distance according to the upper vertices.
         fDeltaBottom - Total vertical distance according to the lower vertices. Usually the same as fDeltaTop.
         bSlowInSlowOut - Indicates if the movement shall be performed as slow-in-slow-out or with constant speed.
         iTotalSteps - Duration of the transition in steps. Default value is <MOVE_STEPS>.
    */
    MoveTransition(AlterableObject* pAlterableObject, float fDeltaLeft, float fDeltaTop,
      float fDeltaBottom, bool bSlowInSlowOut, int iMoveSteps = MOVE_STEPS);

    /*
       Destructor: ~MoveTransition

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


    /*
       Function: Update

         Updates the transition by executing one moving 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 fDeltaLeft;
    float fDeltaTop;
    float fDeltaBottom;
    int iStepsDone;
    bool bSlowInSlowOut;
    int iMoveSteps;
};