#ifndef DEFENSEPOINT_H
#define DEFENSEPOINT_H

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

#include <vector>
using namespace std;

#define DEFENSE_POINT_NORMAL 0
#define DEFENSE_POINT_REVERSE 1
#define DEFENSE_POINT_STOP 2

//Defense Point is one item on the field that the user must click on to slow down and eventually destroy.

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

  void clear();
  void setHitPoints(int);

  void addFormulaX(PositionFormula & pfs);
  void addFormulaY(PositionFormula & pfs);

  bool setPosition(FixedInt speedMultiplier);

  int getPositionX();
  int getPositionY();
  int getHP();
  void addHP (int change);

  void startReversing (int timeRightNow, int activity);
  int getReverse();
  int getStopReverseTime();

  void init(int timeRightNow);

 private:
  int startTime, stopReverseTime, timeElapsed, lastTimePositionWasCalled;
  int reverse;
  int hitPoints;
  int posX, posY;
  vector <PositionFormula> pfX;
  vector <PositionFormula> pfY;

  FixedInt setPositionHelper(int tim, vector<PositionFormula>::iterator startIter, vector<PositionFormula>::iterator endIter, bool &);
};

#endif
