/*
  difficulty_select.js
  fffadedev
  09/01/25

  Manages the selection field for changing the game's difficulty
 */


class DifficultySelect
{
  constructor() {
    this.el = document.getElementById('difficulty');

    // Custom event that triggers when field is changed
    this.el.onchange = (() => {
      if(this.onChooseDifficulty)
        this.onChooseDifficulty(this.el.value);
      console.log("New difficulty selected: " + this.el.value);
    }).bind(this);
  }

  disable()
  {
    this.el.disabled = true;
  }

  enable()
  {
    this.el.disabled = false;
  }
}
