#ifndef VDSPRITE_H
#define VDSPRITE_H



/* **********************************************************************************************************************
   Included Header Files
   **********************************************************************************************************************/

#include <d3d9.h>
#include <d3dx9.h>
#include "VDError.h"



/* **********************************************************************************************************************
   VDSprite
   **********************************************************************************************************************/

class VDSprite {
public:
    VDSprite();
    VDSprite(LPDIRECT3DDEVICE9 direct3DDevice, LPCSTR textureFile, RECT sourceRect, D3DXVECTOR3 aPosition, D3DCOLOR colorKey, int isStaticSprite, int isNPCSprite);
    VDSprite(const VDSprite &copySprite);
    virtual ~VDSprite();

    void Draw(LPD3DXSPRITE sprite);
    void ShiftLocation(LPDIRECT3DDEVICE9 direct3DDevice, float x, float y);
    void MovingSprite(int aDirection);
    void FreeTexture();

    LPDIRECT3DTEXTURE9 GetTexture();
         LPRECT GetSourceRectangle(LPRECT outRect);
           void SetSourceRectangle(LONG left, LONG top, LONG right, LONG bottom);
    D3DXVECTOR3 GetPosition();
           void AddToPosition(float x, float y);
           BOOL IsStatic();
           BOOL IsNPC();
           BOOL IsDead();
           void KillSprite();
           BOOL IsMoving();
           void SetIsMoving(BOOL isItMoving);
            int GetDirection();
           void SetDirection(int aDirection);
            int GetMovingDuration();
           void SetMovingDuration(int amount);
           void AddToMovingDuration(int amount);
           UINT GetSpriteWidth();
           UINT GetSpriteHeight();
protected:
private:
    LPDIRECT3DTEXTURE9 texture;
                  RECT sourceRectangle;
           D3DXVECTOR3 center;
           D3DXVECTOR3 position;
              D3DCOLOR color;
                  BOOL isStatic;
                  BOOL isNPC;
                  BOOL isDead;
                   int direction;
                  BOOL isMoving;
                   int movingDuration;
};



#endif