()
| 610 | } |
| 611 | |
| 612 | private checkAllComplete(): void { |
| 613 | if (this._playing && this._totalTasks === 0) { |
| 614 | if (this._totalTimes < 0) { |
| 615 | this.internalPlay(); |
| 616 | } else { |
| 617 | this._totalTimes--; |
| 618 | if (this._totalTimes > 0) { |
| 619 | this.internalPlay(); |
| 620 | } else { |
| 621 | this._playing = false; |
| 622 | const handler = this._onComplete; |
| 623 | this._onComplete = null; |
| 624 | if (handler) { |
| 625 | if (typeof handler === 'function') handler(); |
| 626 | else if (typeof handler.run === 'function') handler.run(); |
| 627 | } |
| 628 | } |
| 629 | } |
| 630 | } |
| 631 | } |
| 632 | |
| 633 | private internalPlay(): void { |
| 634 | this._ownerBaseX = this._owner.x; |
no test coverage detected