mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-04 07:22:19 +02:00
Apply kev's suggestions from code review
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
This commit is contained in:
parent
20c1932c61
commit
134bf76d44
@ -102,10 +102,6 @@ export class Ability implements Localizable {
|
|||||||
this.attrs = [];
|
this.attrs = [];
|
||||||
this.conditions = [];
|
this.conditions = [];
|
||||||
|
|
||||||
this.isSuppressable = true;
|
|
||||||
this.isCopiable = true;
|
|
||||||
this.isReplaceable = true;
|
|
||||||
|
|
||||||
this.localize();
|
this.localize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,7 +158,15 @@ export abstract class Modifier {
|
|||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** */
|
/**
|
||||||
|
* Return whether this modifier is of the given class
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Used to avoid requiring the caller to have imported the specific modifier class, avoiding circular dependencies.
|
||||||
|
*
|
||||||
|
* @param modifier - The modifier to check against
|
||||||
|
* @returns Whether the modiifer is an instance of the given type
|
||||||
|
*/
|
||||||
public is<T extends ModifierString>(modifier: T): this is ModifierInstanceMap[T] {
|
public is<T extends ModifierString>(modifier: T): this is ModifierInstanceMap[T] {
|
||||||
const targetModifier = ModifierClassMap[modifier];
|
const targetModifier = ModifierClassMap[modifier];
|
||||||
if (!targetModifier) {
|
if (!targetModifier) {
|
||||||
@ -191,7 +199,9 @@ export abstract class PersistentModifier extends Modifier {
|
|||||||
public stackCount: number;
|
public stackCount: number;
|
||||||
public virtualStackCount: number;
|
public virtualStackCount: number;
|
||||||
|
|
||||||
/** */
|
/** This field does not exist at runtime and must not be used.
|
||||||
|
* Its sole purpose is to ensure that typescript is able to properly narrow when the `is` method is called.
|
||||||
|
*/
|
||||||
private declare _: never;
|
private declare _: never;
|
||||||
|
|
||||||
constructor(type: ModifierType, stackCount = 1) {
|
constructor(type: ModifierType, stackCount = 1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user