unorderedIntersect method

Set<Vector2> unorderedIntersect(
  1. ShapeComponent shapeA,
  2. ShapeComponent shapeB
)

Implementation

Set<Vector2> unorderedIntersect(
  ShapeComponent shapeA,
  ShapeComponent shapeB,
) {
  if (shapeA is T1 && shapeB is T2) {
    return intersect(shapeA, shapeB);
  } else if (shapeA is T2 && shapeB is T1) {
    return intersect(shapeB, shapeA);
  } else {
    throw 'Unsupported shapes';
  }
}