import { AfterContentInit , ChangeDetectionStrategy , ChangeDetectorRef , Component , ElementRef , Renderer2 , } from '@angular/core' ; import { CardIds } from '@firestone-hs/reference-data' ; import { DeckCard } from '../../../models/decktracker/deck-card' ; import { CardsFacadeService } from '../../../services/cards-facade.service' ; import { OverwolfService } from '../../../services/overwolf.service' ; import { PreferencesService } from '../../../services/preferences.service' ; import { AppUiStoreFacadeService } from '../../../services/ui-store/app-ui-store-facade.service' ; import { AbstractCounterWidgetWrapperComponent , templateBase } from './abstract-counter-widget-wrapper.component' ; @ Component ( { selector : 'player-elemental-widget-wrapper' , styleUrls : [ '../../../../css/component/overlays/decktracker-player-widget-wrapper.component.scss' ] , template : templateBase , changeDetection : ChangeDetectionStrategy . OnPush , } ) export class PlayerElementalWidgetWrapperComponent extends AbstractCounterWidgetWrapperComponent implements AfterContentInit { constructor ( private readonly allCards , protected readonly ow , protected readonly el , protected readonly prefs , protected readonly renderer , protected readonly store , protected readonly cdr ) { super ( ow , el , prefs , renderer , store , cdr ) ; this . side = 'player' ; this . activeCounter = 'elemental' ; } ngAfterContentInit ( ) { this . prefExtractor = ( prefs ) => prefs . playerElementalCounter ; this . deckStateExtractor = ( state ) => this . containsCards ( state ?. playerDeck ?. hand , [ CardIds . ManaCyclone , CardIds . GrandFinale , CardIds . Ozruk ] ) ; super . ngAfterContentInit ( ) ; } private containsCards ( zone , cardIds ) { return ( zone || [ ] ) . some ( ( card ) => cardIds . includes ( card . cardId ) ) ; } }