mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-04 07:22:19 +02:00
Update removeTag to allow BOTH to be removed
Create handling for removal of either a specific side, or both sides.
This commit is contained in:
parent
81f2d150a6
commit
87770dd439
@ -518,7 +518,15 @@ export class Arena {
|
||||
}
|
||||
|
||||
removeTag(tagType: ArenaTagType, side: ArenaTagSide = ArenaTagSide.BOTH): boolean {
|
||||
const tags = this.tags;
|
||||
const tags = this.tags
|
||||
if(side == ArenaTagSide.BOTH){
|
||||
tags.filter(t => (t.tagType == tagType)).forEach(t => {
|
||||
t.onRemove(this);
|
||||
tags.splice(tags.indexOf(t), 1);
|
||||
})
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
const tag = tags.find(t => t.tagType === tagType && t.side === side);
|
||||
if (tag) {
|
||||
tag.onRemove(this);
|
||||
@ -526,6 +534,7 @@ export class Arena {
|
||||
}
|
||||
return !!tag;
|
||||
}
|
||||
}
|
||||
|
||||
removeAllTags(): void {
|
||||
while (this.tags.length) {
|
||||
|
Loading…
Reference in New Issue
Block a user