#include <string>
#include <vector>
#include "CMain.hpp"
#include "CPlayer.hpp"

#ifndef CBATTLE_HPP
#define CBATTLE_HPP

class CCoord
{
public:
       CCoord();
       bool hit;
};

class CBattle
{
      int posx, posy; // Holds the central coord of where the movement 'block' starts
      int turn; // Determines who's turn it is... PC[0], PC[1] or NPCs

      BITMAP *choice_bmp;
      BITMAP *selector;
      
      int accumulated_gold;
      int accumulated_exp;
      
public:
   CBattle();
   // These point to where the character goes after winning the battle
   // these are OVERRIDED by CPortal dest (only if the battle was started from a portal)

   void Battle(bool isportal);
   void HandlePlayerMovement(int which);
   void DrawGrid(int which, int radius);
   void ClearGrid();
   void ViewBattlefield(int which);
   bool AttackSelect(int which);  // determines where and when the player can make a selection to attack another npc/obj
   void PlayerAttack(int which, int npcnum);
   void FinalizeBattle(int which, int x, int y);
   std::vector< std::vector <CCoord> > coord;
   
   bool NpcAttack(int num, int x, int y, int target);
   
   void DeathSequence();

};

extern CBattle battle;

#endif
