private int calculateFilledPointsInDir(int startX, int startY, int dirX, int dirY, int index) {
        int count = 0;
        int tmpX = startX;
        int tmpY = startY;
        for (int i = 1; i < 5; ++i) {
            tmpX += dirX;
            tmpY += dirY;
            if (tmpX < 0 || tmpX >= gameRes.getFieldSize() || tmpY < 0 || tmpY >= gameRes.getFieldSize() ||
                    gameField[tmpX][tmpY] != index) {
                break;
            }
            count++;
        }
        return count;
    }