Cell.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #pragma once
  2. #include <queue>
  3. #include <vector>
  4. class Unit;
  5. class Cell {
  6. private:
  7. Cell *upLeft_;
  8. Cell *up_;
  9. Cell *upRight_;
  10. Cell * downLeft_;
  11. Cell *down_;
  12. Cell *downRight_;
  13. Unit *character_;
  14. bool isMoveable_;
  15. bool isAttackable_;
  16. int distance_;
  17. bool AddedToQuery_;
  18. void clearTable_();
  19. void clearCell_();
  20. void handleAllMoveableCellsAndUnmoveableCells_(std::queue<Cell*> & Q);
  21. void handleAllUnmoveableCells_(std::queue<Cell*> & Q);
  22. public:
  23. explicit Cell(Unit & character);
  24. Cell * getUpLeft();
  25. void setUpLeft(Cell *);
  26. Cell * getUp();
  27. void setUp(Cell *);
  28. Cell * getUpRight();
  29. void setUpRight(Cell *);
  30. Cell * getDownLeft();
  31. void setDownLeft(Cell *);
  32. Cell * getDown();
  33. void setDown(Cell *);
  34. Cell * getDownRight();
  35. void setDownRight(Cell *);
  36. Unit * getCharacter();
  37. void setCharacter(Unit *);
  38. bool getisMoveable();
  39. void setisMoveable(bool);
  40. bool getisAttackable();
  41. void setisAttackable(bool);
  42. int getDistance();
  43. void setDistance(int);
  44. bool isEmpty();
  45. void RecalculateTableWithCenterThisPoint();
  46. std::vector <Cell*> actualPath(Cell*);
  47. };