mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-04 07:22:19 +02:00
Revert "Revert predicate stuff for now"
This reverts commit 565e18fcb2
.
This commit is contained in:
parent
0c54fc1be0
commit
6b610137b1
@ -19,7 +19,12 @@ import {
|
||||
type Constructor,
|
||||
} from "#app/utils/common";
|
||||
import { deepMergeSpriteData } from "#app/utils/data";
|
||||
import type { Modifier, ModifierPredicate, TurnHeldItemTransferModifier } from "./modifier/modifier";
|
||||
import type {
|
||||
Modifier,
|
||||
ModifierIdentityPredicate,
|
||||
ModifierPredicate,
|
||||
TurnHeldItemTransferModifier,
|
||||
} from "./modifier/modifier";
|
||||
import {
|
||||
ConsumableModifier,
|
||||
ConsumablePokemonModifier,
|
||||
@ -3361,6 +3366,11 @@ export default class BattleScene extends SceneBase {
|
||||
return (isPlayer ? this.modifiers : this.enemyModifiers).filter(modifierFilter);
|
||||
}
|
||||
|
||||
findModifier<T extends PersistentModifier>(
|
||||
modifierFilter: ModifierIdentityPredicate<T>,
|
||||
player?: boolean,
|
||||
): T | undefined;
|
||||
findModifier(modifierFilter: ModifierPredicate, player?: boolean): PersistentModifier | undefined;
|
||||
/**
|
||||
* Find the first modifier that pass the `modifierFilter` function
|
||||
* @param modifierFilter The function used to filter a target's modifiers
|
||||
|
@ -55,6 +55,7 @@ import {
|
||||
import { globalScene } from "#app/global-scene";
|
||||
|
||||
export type ModifierPredicate = (modifier: Modifier) => boolean;
|
||||
export type ModifierIdentityPredicate<T extends Modifier> = (modifier: Modifier) => modifier is T;
|
||||
|
||||
const iconOverflowIndex = 24;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user