Apply suggestions from code review

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
This commit is contained in:
Mumble 2024-10-01 21:21:35 -07:00 committed by GitHub
parent bb99bcac8d
commit 94aeacfa47
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 16 deletions

View File

@ -965,19 +965,16 @@ class ImprisonTag extends ArenaTrapTag {
/**
* Helper function that retrieves the source Pokemon
* @param {BattleScene} scene medium to retrieve the source Pokemon
* @returns {Pokemon} pokemon or undefined
* @param scene medium to retrieve the source Pokemon
* @returns The source {@linkcode Pokemon} or `null` if none is found
*/
private retrieveSource(scene: BattleScene): Pokemon | undefined {
if (this.sourceId) {
return scene.getPokemonById(this.sourceId) ?? undefined;
}
return undefined;
private retrieveSource(scene: BattleScene): Pokemon | null {
return this.sourceId ? scene.getPokemonById(this.sourceId) : null;
}
/**
* Helper function that retrieves the Pokemon affected
* @param {BattleScene} scene medium to retrieve the involved Pokemon
* @param scene medium to retrieve the involved Pokemon
* @returns list of opposing Pokemon on the field
*/
private retrieveField(scene: BattleScene): PlayerPokemon[] | EnemyPokemon[] {
@ -1004,7 +1001,7 @@ class ImprisonTag extends ArenaTrapTag {
* @param _arena
* @returns `true` if the source of the tag is still active on the field | `false` if not
*/
override lapse({ scene }: Arena): boolean {
override lapse({ scene }: BattleScene): boolean {
const source = this.retrieveSource(scene);
return source ? source.isActive(true) : false;
}

View File

@ -332,7 +332,7 @@ export class GorillaTacticsTag extends MoveRestrictionBattlerTag {
/**
* Loads the Gorilla Tactics Battler Tag along with its unique class variable moveId
* @override
* @param source {@linkcode BattlerTag} Gorilla Tactic's Battler Tag information
* @param source Gorilla Tactics' {@linkcode BattlerTag} information
*/
override loadTag(source: BattlerTag | any): void {
super.loadTag(source);
@ -2633,13 +2633,10 @@ export class ImprisonTag extends MoveRestrictionBattlerTag {
/**
* Helper function that retrieves the source Pokemon object
* @param scene medium to retrieve the source Pokemon
* @returns source pokemon {@linkcode Pokemon} or undefined
* @returns The source {@linkcode Pokemon} or `null` if none is found
*/
private retrieveSource(scene: BattleScene): Pokemon | undefined {
if (this.sourceId) {
return scene.getPokemonById(this.sourceId) ?? undefined;
}
return undefined;
private retrieveSource(scene: BattleScene): Pokemon | null {
return this.sourceId ? scene.getPokemonById(this.sourceId) : null;
}
}