#ifndef POWERSELECTOR_H
#define POWERSELECTOR_H

#include <stdint.h>
#include "SDL.h"

#include "../util/ResourceHandler.h"
#include "../util/mathUtils.h"

#include <vector>
using namespace std;

//The Power Selector is a panel of 10 buttons.
//9 are in a 3x3 grid with the 10th taking up the right side.
//The user is able to click on a button to highlight it and again to confirm a choice.

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

  void clear();

  //access and get the selected index.
  int getSelected();
  void setSelected(int);

  //You can get the previously selected index.
  int getPreviousSelected();

  //get and set the dimensions of an individual box.
  void setIndividualBoxDimensions (uint16_t w, uint16_t h);
  uint16_t getIndividualBoxWidth ();
  uint16_t getIndividualBoxHeight ();

  //If the mouse clicks at this position, change the selected element if it clicked on something.
  int mouseClickUpdate (int mouseX, int mouseY, int mouseButton);

  //position
  void setPositionX (int);
  int getPositionX();

  void setPositionY (int);
  int getPositionY();

 private:
  int selected, previousSelected;
  uint16_t indyWid, indyHei;
  int posX, posY;
};

#endif
