Document setTags and hasTag function

This commit is contained in:
AJ Fontaine 2025-01-16 21:28:38 -05:00
parent 9ec4667aaf
commit a355c493fc

View File

@ -128,12 +128,22 @@ export class SpeciesFormEvolution {
: EvolutionTag.TRIGGER_USE_ITEM | EvolutionTag.ULTRA_ITEM; : EvolutionTag.TRIGGER_USE_ITEM | EvolutionTag.ULTRA_ITEM;
} }
setTags(tags: EvolutionTag): SpeciesFormEvolution { /**
* Setter for the {@linkcode EvolutionTag} bitfield for this evolution
* @param tags the tags to set, can be combined with bitwise OR |
* @returns this {@linkcode SpeciesFormEvolution}
*/
public setTags(tags: EvolutionTag): this {
this.tags |= tags; this.tags |= tags;
return this; return this;
} }
hasTag(tag: EvolutionTag): boolean { /**
* Checks for a certain {@linkcode EvolutionTag} for a {@linkcode SpeciesFormEvolution}.
* @param tag the {@linkcode EvolutionTag} to check for. Multiple can be checked at once with the bitwise OR operator |
* @returns whether this evolution has the requested tags set
*/
public hasTag(tag: EvolutionTag): boolean {
return (tag & this.tags) > 0; return (tag & this.tags) > 0;
} }
} }