123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- #pragma once
- #include <queue>
- #include <vector>
- #include <iostream>
- class Unit;
- class EffectsForCell;
- class Cell {
- private:
-
- Cell* leftUp_;
- Cell* left_;
- Cell* leftDown_;
- Cell* rightUp_;
- Cell* right_;
- Cell* rightDown_;
-
- Unit* character_;
-
- std::vector<EffectsForCell*> effects_list_;
-
- bool isMoveAble_;
- bool isMeleeAttackAble_;
- bool isRangeAttackAble_;
-
- int distance_barrier_;
- int distance_through_;
- private:
-
- bool AddedToQuery_;
- int col_, row_;
- void clearTable_();
- void clearCell_();
- void recalcAttackable_(Cell*, bool);
- void recalcMoveable_(Cell*, bool);
-
- void updateMoveableCells_(std::queue<Cell *> &Q);
-
- void updateUnMovealeCells_(std::queue<Cell *> &Q);
- public:
- explicit Cell(Unit * character);
-
- Cell* getleftUp();
- void setleftUp(Cell*);
- Cell* getleft();
- void setleft(Cell*);
- Cell* getleftDown();
- void setleftDown(Cell*);
- Cell* getrightUp();
- void setrightUp(Cell*);
- Cell* getright();
- void setright(Cell*);
- Cell* getrightDown();
- void setrightDown(Cell *);
- Unit* getCharacter();
- void setCharacter(Unit *);
-
- int getdistance_barrier();
- void setdistance_barrier(int);
- int getdistance_through();
- void setdistance_through(int);
-
- bool getisMoveAble();
- void setisMoveAble(bool);
- bool getisMeleeAttackAble();
- void setisMeleeAttackAble(bool);
- bool getisRangeAttackAble();
- void setisRangeAttackAble(bool);
-
- bool isEmpty();
-
- void recalculateAllEffectsList();
- void add(EffectsForCell*);
- void remove(std::vector<EffectsForCell*>::iterator);
- void remove(EffectsForCell*);
- std::vector<EffectsForCell*>::iterator beginIteratorEffectsList();
- std::vector<EffectsForCell*>::iterator endIteratorEffectsList();
-
- void RecalculateTableWithCenterThisPoint();
-
- std::vector <Cell*> actualPath(Cell*);
-
- Cell* getRealShootTarget(Cell*);
- };
|