export default class GameController {
  constructor(model, view) {
    this.model = model;
    this.view = view;

    this.view.bindPlay(this.handlePlay);
    this.view.displayScore(this.model.getScore());
  }

  handlePlay = (playerChoice) => {
    const computerChoice = this.model.getComputerChoice();
    const result = this.model.getResult(playerChoice, computerChoice);

    this.view.displayResult(playerChoice, computerChoice, result);
    this.view.displayScore(this.model.getScore());
  }
}

