import { ChangeDetectorRef, Component, NgZone, OnInit } from '@angular/core';
import { AvalonService } from '../../../services/avalon.service';
import { AvalonBase } from '../avalonBase';

@Component({
  selector: 'avalon-team-vote',
  templateUrl: './team-vote.component.html',
  styleUrls: ['./team-vote.component.scss']
})
export class TeamVoteComponent extends AvalonBase implements OnInit {

  constructor(
    protected cdRef: ChangeDetectorRef,
    protected avalonService: AvalonService,
    private ngZone: NgZone
  ) {
    super(cdRef, avalonService);
  }

  ngOnInit(): void {
  }

  public voteTeamVote(value: boolean) {
    this.me.teamVote = value;
    this.broadcastMe('VoteTeamMate');
    this.avalonService.applyCdChange$.next();
  }
}
