Cell.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #pragma once
  2. #include <queue>
  3. #include <vector>
  4. class Unit;
  5. class Cell {
  6. private:
  7. Cell * leftUp_;
  8. Cell *left_;
  9. Cell * leftDown_;
  10. Cell *rightUp_;
  11. Cell *right_;
  12. Cell *rightDown_;
  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 * getleftUp();
  25. void setleftUp(Cell *);
  26. Cell * getleft();
  27. void setleft(Cell *);
  28. Cell * getleftDown();
  29. void setleftDown(Cell *);
  30. Cell * getrightUp();
  31. void setrightUp(Cell *);
  32. Cell * getright();
  33. void setright(Cell *);
  34. Cell * getrightDown();
  35. void setrightDown(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. };