clone method

CollisionArea clone()

Implementation

CollisionArea clone() {
  late Shape newShape;
  if (shape is PolygonShape) {
    newShape = PolygonShape((shape as PolygonShape).points);
  } else if (shape is CircleShape) {
    newShape = CircleShape((shape as CircleShape).radius);
  } else {
    newShape = RectangleShape((shape as RectangleShape).rect.sizeVector2);
  }
  return CollisionArea(
    newShape,
    align: align?.clone(),
  );
}