mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-16 04:19:32 +02:00
Update src/data/phase-priority-queue.ts
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
This commit is contained in:
parent
018a0091f3
commit
d576da72d2
@ -54,8 +54,10 @@ export abstract class PhasePriorityQueue {
|
|||||||
* @todo Remove this eventually once the patchwork bug this is used for is fixed
|
* @todo Remove this eventually once the patchwork bug this is used for is fixed
|
||||||
*/
|
*/
|
||||||
public tryRemovePhase(phaseFilter: (phase: Phase) => boolean, removeCount: number | "all" = 1): number {
|
public tryRemovePhase(phaseFilter: (phase: Phase) => boolean, removeCount: number | "all" = 1): number {
|
||||||
if (typeof removeCount === "string") {
|
if (removeCount === "all") {
|
||||||
removeCount = Number.MAX_SAFE_INTEGER; // For the lulz
|
removeCount = Number.MAX_SAFE_INTEGER;
|
||||||
|
} else if (removeCount < 1) {
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
let numRemoved = 0;
|
let numRemoved = 0;
|
||||||
let phaseIndex = this.queue.findIndex(phaseFilter);
|
let phaseIndex = this.queue.findIndex(phaseFilter);
|
||||||
|
Loading…
Reference in New Issue
Block a user