コード例 #1
0
    private MatrixIntersection[] GetIntersections(MatrixInfo matrix)
    {
        List <MatrixIntersection> intersections = null;

        foreach (var otherMatrix in ActiveMatrices)
        {
            if (matrix == otherMatrix)
            {
                continue;
            }
            if (matrix.BoundsIntersect(otherMatrix, out Rect hotZone))
            {
                if (intersections == null)
                {
                    intersections = new List <MatrixIntersection>();
                }

                intersections.Add(new MatrixIntersection
                {
                    Matrix1 = matrix,
                    Matrix2 = otherMatrix,
                    Rect    = hotZone
                });
            }
        }

        if (intersections != null)
        {
            return(intersections.ToArray());
        }
        return(noIntersections);
    }
コード例 #2
0
    private MatrixIntersection[] GetIntersections(MatrixInfo matrix)
    {
        List <MatrixIntersection> intersections = null;

        foreach (var otherMatrix in ActiveMatrices.Values)
        {
            if (matrix == null || matrix == otherMatrix)
            {
                continue;
            }
            if (matrix.BoundsIntersect(otherMatrix, out BetterBounds hotZone))
            {
                if (intersections == null)
                {
                    intersections = new List <MatrixIntersection>();
                }

                intersections.Add(new MatrixIntersection(matrix, otherMatrix, hotZone));
            }
        }

        if (intersections != null)
        {
            return(intersections.ToArray());
        }
        return(noIntersections);
    }