#ifndef DEFENSEARRAY_H
#define DEFENSEARRAY_H

#include "../util/Param.h"
#include "../util/FixedInt.h"
#include "../util/PositionFormula.h"
#include "DefensePoint.h"

#include <vector>
using namespace std;

//Defense Array manages the Defense Points and sends data to the StateHandler and Renderer.

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

  void clear();

  //Parry window is the section the user can click on to deflect projectiles.
  void setParryWindowWidth(int);
  int getParryWindowWidth();

  void setParryWindowHeight(int);
  int getParryWindowHeight();

  //assumes the Defense Points move from the right side to the left side.
  void setMovingLeft (bool);
  bool getMovingLeft ();

  //window dimensions determine the bounds the DefensePoints can appear in. It also determines the distance the points can exceed to hit the player.
  int getWindowWidth ();
  void setWindowWidth (int);

  int getWindowHeight ();
  void setWindowHeight (int);

  //travelSpeed is a global multiplier on the item speed.
  FixedInt getTravelSpeed ();
  void setTravelSpeed (FixedInt);

  //add DefensePoints
  void addDefensePoint(DefensePoint &);
  //subtract HP from a DefensePoint. If its HP is 0, remove it.
  int removeHPFromDefensePoint (int index, int damage);
  void removeDefensePoint (int index);
  
  //temporarily reverse or stop a defense point.
  bool startReversingDefensePoint (int index, int activity);

  //retrieve locations of a Defense Array.
  void getDefensePointLocations(vector<int> & xLocations, vector<int> & yLocations, vector<int> & radii, vector<int>& indecies);

  //gets the number of points in the array.
  int getNumberOfDefensePoints();

  //initialRadius settings
  int getInitialRadius ();
  void setInitialRadius (int ir);
 private:
  vector <DefensePoint> defensePoints;
  int parryWindowWidth, parryWindowHeight;
  int windowWidth, windowHeight;
  int initialRadius;
  bool movingLeft;
  FixedInt travelSpeed;
};

#endif
