|
@@ -1,24 +1,21 @@
|
|
-#include "Cell.h"
|
|
|
|
|
|
+#include "../include/Cell.h"
|
|
#include <assert.h>
|
|
#include <assert.h>
|
|
#include <string>
|
|
#include <string>
|
|
#include <string.h>
|
|
#include <string.h>
|
|
-//#include "unit.h"
|
|
|
|
|
|
+/*
|
|
|
|
+ * ????? ??????? ??? ???? ? ?????????? ?????????? ????
|
|
|
|
+ */
|
|
|
|
+//#include "../include/units/unit.h"
|
|
|
|
+class Unit{
|
|
|
|
+public:
|
|
|
|
+ bool canMoveForDistance(int);
|
|
|
|
+ bool canAttackForDistance(std::string, int);
|
|
|
|
+};
|
|
#include <queue>
|
|
#include <queue>
|
|
#include <vector>
|
|
#include <vector>
|
|
#include <map>
|
|
#include <map>
|
|
#include <iostream>
|
|
#include <iostream>
|
|
|
|
|
|
-class Unit{
|
|
|
|
-private:
|
|
|
|
-public:
|
|
|
|
- bool CanMoveForDistance(int distance){
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
- bool CanAttackForDistance(std::string AttackType, int distance){
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
class EffectsForCell{
|
|
class EffectsForCell{
|
|
public:
|
|
public:
|
|
void OperateOnCell(Cell*){}
|
|
void OperateOnCell(Cell*){}
|
|
@@ -215,12 +212,12 @@ void Cell::clearTable_() {
|
|
void Cell::recalcAttackable_(Cell * Now,bool isReached){
|
|
void Cell::recalcAttackable_(Cell * Now,bool isReached){
|
|
if(Now == nullptr)return;
|
|
if(Now == nullptr)return;
|
|
if (!isEmpty() && !Now->isEmpty() &&
|
|
if (!isEmpty() && !Now->isEmpty() &&
|
|
- getCharacter()->CanAttackForDistance("Melee", Now->getdistance_barrier())
|
|
|
|
|
|
+ getCharacter()->canAttackForDistance("Melee", Now->getdistance_barrier())
|
|
) {
|
|
) {
|
|
Now->setisMeleeAttackAble(isReached);
|
|
Now->setisMeleeAttackAble(isReached);
|
|
}
|
|
}
|
|
if (!isEmpty() && !Now->isEmpty() &&
|
|
if (!isEmpty() && !Now->isEmpty() &&
|
|
- getCharacter()->CanAttackForDistance("Range", Now->getdistance_barrier())
|
|
|
|
|
|
+ getCharacter()->canAttackForDistance("Range", Now->getdistance_barrier())
|
|
) {
|
|
) {
|
|
Now->setisRangeAttackAble(true);
|
|
Now->setisRangeAttackAble(true);
|
|
}
|
|
}
|
|
@@ -229,7 +226,7 @@ void Cell::recalcAttackable_(Cell * Now,bool isReached){
|
|
void Cell::recalcMoveable_(Cell * Now, bool isReached){
|
|
void Cell::recalcMoveable_(Cell * Now, bool isReached){
|
|
if(Now == nullptr || Now->isEmpty() || isEmpty())return;
|
|
if(Now == nullptr || Now->isEmpty() || isEmpty())return;
|
|
if(!isEmpty() && Now->isEmpty() &&
|
|
if(!isEmpty() && Now->isEmpty() &&
|
|
- getCharacter()->CanMoveForDistance(Now->getdistance_barrier())){
|
|
|
|
|
|
+ getCharacter()->canMoveForDistance(Now->getdistance_barrier())){
|
|
Now->setisMoveAble(isReached);
|
|
Now->setisMoveAble(isReached);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -287,10 +284,6 @@ void Cell::updateUnMovealeCells_(std::queue<Cell*> & Q) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-void Cell::print() {
|
|
|
|
- std::cout << "(" << col_ << ", " << row_ << ")";
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
Cell* Cell::getRealShootTarget(Cell* next){
|
|
Cell* Cell::getRealShootTarget(Cell* next){
|
|
if(next == this){
|
|
if(next == this){
|
|
return next;
|
|
return next;
|
|
@@ -339,4 +332,6 @@ Cell* Cell::getRealShootTarget(Cell* next){
|
|
if(next_row < row_main_diag)return getrightDown();
|
|
if(next_row < row_main_diag)return getrightDown();
|
|
return getright();
|
|
return getright();
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+int main(){}
|