Cell.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #pragma once
  2. #include <queue>
  3. #include <vector>
  4. class Unit;
  5. class Cell {
  6. int i, j;
  7. private:
  8. Cell * left_up_;
  9. Cell *left_;
  10. Cell * left_down_;
  11. Cell *right_up_;
  12. Cell *right_;
  13. Cell *right_down_;
  14. Unit *character_;
  15. bool isMoveable_;
  16. bool isAttackable_;
  17. int distance_;
  18. bool AddedToQuery_;
  19. void clearTable_(bool);
  20. void clearCell_();
  21. void handleAllMoveableCellsAndUnmoveableCells_(std::queue<Cell*> & Q);
  22. void handleAllUnmoveableCells_(std::queue<Cell*> & Q);
  23. public:
  24. explicit Cell(Unit * character);
  25. explicit Cell(int, int);
  26. Cell * getLeftUp();
  27. void setLeftUp(Cell *);
  28. Cell * getLeft();
  29. void setLeft(Cell *);
  30. Cell * getLeftDown();
  31. void setLeftDown(Cell *);
  32. Cell * getRightUp();
  33. void setRightUp(Cell *);
  34. Cell * getRight();
  35. void setRight(Cell *);
  36. Cell * getRightDown();
  37. void setRightDown(Cell *);
  38. Unit * getCharacter();
  39. void setCharacter(Unit *);
  40. bool getIsMoveable();
  41. void setIsMoveable(bool);
  42. bool getIsAttackable();
  43. void setIsAttackable(bool);
  44. int getDistance();
  45. void setDistance(int);
  46. bool isEmpty();
  47. void recalculateTableWithCenterThisPoint();
  48. void buffTableinDistance(int);
  49. std::vector <Cell*> actualPath(Cell*);
  50. };