private DIRECTION GetNearObjDirection(CellPosition pos, Cell.CASE_OBJECT objType) { if (IsInWidth(pos.x + 1)) { if (tabCells[pos.x + 1, pos.y].obj == objType) { return(DIRECTION.East); } } if (IsInWidth(pos.x - 1)) { if (tabCells[pos.x - 1, pos.y].obj == objType) { return(DIRECTION.West); } } if (IsInHeight(pos.y + 1)) { if (tabCells[pos.x, pos.y + 1].obj == objType) { return(DIRECTION.North); } } if (IsInHeight(pos.y - 1)) { if (tabCells[pos.x, pos.y - 1].obj == objType) { return(DIRECTION.South); } } return(DIRECTION.None); }
private bool IsObjNear(CellPosition pos, Cell.CASE_OBJECT objType) { return(GetNearObjDirection(pos, objType) != DIRECTION.None); }