#ifndef VDMAPEDITOR_H
#define VDMAPEDITOR_H



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

#include <windows.h>
#include "VDSprite.h"
#include "VDInput.h"
#include "VDNPC.h"
#include "VDError.h"
#include "Resource.h"



/* **********************************************************************************************************************
   VDMapEditor
   **********************************************************************************************************************/

class VDMapEditor {
public:
    VDMapEditor();
    ~VDMapEditor();

    void FreeMemory();
    HWND CreateMapEditor(HINSTANCE instance, HWND parentWindow, LPCSTR className);
    void ProcessMapEditor(LPDIRECT3DDEVICE9 direct3DDevice, VDInput *input, vector<VDNPC>* npcs);
    void VDOpenFile(HWND window, LPSTR filter, LPSTR fileName);

         HWND GetWindow();
         HWND GetTransparencyColor();
         HWND GetLoadSpriteButton();
    VDSprite* GetTileSheet();
         void SetTileSheet(VDSprite *newSprite);
       LPCSTR GetTileSheetImageLocation();
         void SetTileSheetImageLocation(LPCSTR imageLocation);
       LPRECT GetTileSheetDimensions(LPRECT outRect);
       LPRECT GetTileSheetSourceRectangle(LPRECT outRect);
         void SetTileSheetSourceRectangle(LONG left, LONG top, LONG right, LONG bottom);
    VDSprite* GetSelectedTile();
         void SetSelectedTile(VDSprite *newSprite);
       LPCSTR GetSelectedTileImageLocation();
         void SetSelectedTileImageLocation(LPCSTR imageLocation);
         HWND GetShiftTileSpriteUp();
         HWND GetShiftTileSpriteDown();
         HWND GetShiftTileSpriteLeft();
         HWND GetShiftTileSpriteRight();
         HWND GetTileSpawnsListBox();
         HWND GetCreaturesListBox();
         HWND GetRemoveSpawnButton();
         HWND GetAddSpawnButton();
         HWND GetNullTileOption();
         HWND GetOpenTileOption();
         HWND GetImpassableTileOption();
         HWND GetNewAreaTileOption();
         HWND GetLoadNewAreaButton();
         HWND GetNewAreaStatic();
       LPCSTR GetNewAreaFileLocation();
         void SetNewAreaFileLocation(LPCSTR aFileLocation);
         HWND GetNewAreaStartingPointX();
         HWND GetNewAreaStartingPointY();
         HWND GetNPCListBox();
    VDSprite* GetNPCSprite();
         void SetNPCSprite(VDSprite *newSprite);
       LPCSTR GetSelectedNPCImageLocation();
         void SetSelectedNPCImageLocation(LPCSTR imageLocation);
         void SetPreviousNPCSelection(LPCSTR npcName);
       LPRECT GetNPCSpriteDimensions(LPRECT outRect);
         HWND GetPreviousAnimationButton();
         HWND GetNextAnimationButton();
         HWND GetNullNPCOption();
         HWND GetNormalNPCOption();
         HWND GetStaticNPCOption();
         BOOL IsTileSelected();
         void SetTileSelected(BOOL isSelected);
private:
         HWND window;
         HWND transparencyColor;
         HWND loadSpriteButton;
    VDSprite* tileSheet;
         char tileSheetImageLocation[FILE_NAME_MAX_SIZE];
         RECT tileSheetDimensions;
         RECT tileSheetSourceRectangle;
    VDSprite* selectedTile;
         char selectedTileImageLocation[FILE_NAME_MAX_SIZE];
         HWND shiftTileSpriteUp;
         HWND shiftTileSpriteDown;
         HWND shiftTileSpriteLeft;
         HWND shiftTileSpriteRight;
         HWND tileSpawnsListBox;
         HWND creaturesListBox;
         HWND removeSpawnButton;
         HWND addSpawnButton;
         HWND nullTileOption;
         HWND openTileOption;
         HWND impassableTileOption;
         HWND newAreaTileOption;
         HWND loadNewAreaButton;
         HWND newAreaStatic;
         char newAreaFileLocation[FILE_NAME_MAX_SIZE];
         HWND newAreaStartingPointX;
         HWND newAreaStartingPointY;
         HWND npcsListBox;
    VDSprite* npcSprite;
         char selectedNPCImageLocation[FILE_NAME_MAX_SIZE];
         char previousNPCSelection[FILE_NAME_MAX_SIZE];
         RECT npcSpriteDimensions;
         HWND previousAnimationButton;
         HWND nextAnimationButton;
         HWND nullNPCOption;
         HWND normalNPCOption;
         HWND staticNPCOption;
         BOOL tileSelected;
};



#endif  // VDMAPEDITOR_H