"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.destroy = void 0; const Bounce_1 = require("./Bounce"); function destroy(p1, p2) { if (!p1.unbreakable && !p2.unbreakable) { (0, Bounce_1.bounce)(p1, p2); } if (p1.getRadius() === undefined && p2.getRadius() !== undefined) { p1.destroy(); } else if (p1.getRadius() !== undefined && p2.getRadius() === undefined) { p2.destroy(); } else if (p1.getRadius() !== undefined && p2.getRadius() !== undefined) { const deleteP = p1.getRadius() >= p2.getRadius() ? p1 : p2; deleteP.destroy(); } } exports.destroy = destroy;