#ifndef VDWORLD_H
#define VDWORLD_H



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

#include "VDTile.h"
#include "VDNPC.h"



/* **********************************************************************************************************************
   VDWorld
   **********************************************************************************************************************/

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

    BOOL IsTileInBounds(int locationX, int locationY);
    BOOL IsTileVacant(int entityLocationX, int entityLocationY);
     int ReallocateWorld(int worldMouseLocationX, int worldMouseLocationY);
    void AddNPC(LPCSTR name, int locationX, int locationY, LPCSTR imageFileLocation, int status, int facingDirection, D3DCOLOR colorKey);
    void RemoveNPC(int locationX, int locationY);
     int RunNPCLogic(unsigned int index, double currentTime);
    void MoveNPC(unsigned int index, int direction);
    void ClearWorld();
    void WriteWorld(LPCSTR fileName);
    void LoadWorld(LPCSTR fileName);

       int GetTileStatus(int x, int y);
      void SetTileStatus(int x, int y, int theStatus);
    LPCSTR GetTileImageFileLocation(int x, int y);
      void SetTileImageFileLocation(int x, int y, LPCSTR theImageFileLocation);
    LPCSTR GetTileNewAreaName(int x, int y);
       int GetTileNewAreaStartingPointX(int x, int y);
       int GetTileNewAreaStartingPointY(int x, int y);
      void SetTileNewArea(int x, int y, LPCSTR newAreaName, int startingLocationX, int startingLocationY);
       int GetWorldSizeX();
       int GetWorldSizeY();
    size_t GetNPCsSize();
    LPCSTR GetNPCName(unsigned int index);
       int GetNPCCurrentLocationX(unsigned int index);
       int GetNPCCurrentLocationY(unsigned int index);
      void SetNPCCurrentLocation(unsigned int index, int x, int y);
       int GetNPCDirection(unsigned int index);
    LPCSTR GetNPCImageFileLocation(unsigned int index);
    LPCSTR GetNPCDialogue(unsigned int npcIndex, unsigned int dialogueIndex);
  D3DCOLOR GetObjectColorKey(unsigned int index);
private:
    enum Status {
        NA,
        OPEN,
        BLOCKED,
        NEWAREA
    };

         VDTile** world;
              int worldSizeX;
              int worldSizeY;
    vector<VDNPC> npcs;
};



#endif