Source: model/ModelScore.js

/**
 * @author    Wolfgang Kowarschick <kowa@hs-augsburg.de>
 * @copyright 2017 - 2018
 * @license   CC-BY-NC-SA-4.0
 */

/**
 * @property {number} score - the content of the score field
 *
 * @property {number} x    - the x position of the circle
 * @property {number} y    - the y position of the circle
 */
class ModelScore
{ /**
   * @param {Object} [p_config]
   * @param {number} [p_config.score = 0]
   * @param {number} [p_config.x = 0]
   * @param {number} [p_config.y = 0]
   */
  constructor(p_config = {})
  { this.config = p_config;
    this.reset();
  }
  
  reset()
  { const {score=0, x=0, y=0} = this.config;
  
    this.score = score;
    this.x     = x;
    this.y     = y;
  }
  
  /**
   * @returns {string} returns <code>this.score</code> as string
   */
  get text()
  { return this.score.toString(); }
}

export {ModelScore};