playTile(currentPlayTile) {
    if (currentPlayTile === noPlayer) {
      this.state = noPlayer;
      this.img = new Image();
      this.img.src = this._canvas.toDataURL(); // State of the Canvas (DataURL -> Base64 - PNG)
      this._canvasContext.fillRect(this.rectXCoOrd, this.rectYCoOrd, baseWidth, baseHeight);
    } else if (currentPlayTile === playerO) {
      this.state = playerO;
      this._canvasContext.fillRect(this.rectXCoOrd, this.rectYCoOrd, baseWidth, baseHeight);
      this._canvasContext.beginPath(); // Create Base PolyGon
      this._canvasContext.arc(this.circleXCoOrd, this.circleYCoOrd, this.circleRadiusNumber, this.circleStartAngle, this.circleEndAngle); // Create Circle
      this._canvasContext.stroke();
      this.img = new Image();
      this.img.src = this._canvas.toDataURL();
    } else if (currentPlayTile === playerX) {
      this.state = playerX;
      this._canvasContext.fillRect(this.rectXCoOrd, this.rectYCoOrd, baseWidth, baseHeight);
      this._canvasContext.beginPath();
      this._canvasContext.moveTo(this.crossXCoOrd, this.crossYCoOrd);
      this._canvasContext.lineTo(this.crossXStart, this.crossYStart);
      this._canvasContext.moveTo(this.crossXStart, this.crossYCoOrd);
      this._canvasContext.lineTo(this.crossXCoOrd, this.crossYStart);
      this._canvasContext.stroke();
      this.img = new Image();
      this.img.src = this._canvas.toDataURL();
    } else {
      console.log("playTile() - Invalid Argument: " + currentPlayTile);
    }
  }
/**
   * Setup the Canvas Context according to the input type of Tile (Blank, Cross or Circle).
   * 
   * @param {String} currentPlayTile 
   */
Setup the Canvas Context according to the input type of Tile (Blank, Cross or Circle).


Setup the Canvas Context according to the input type of Tile ( Blank Cross or Circle ) .
playTile(currentPlayTile) {
    if (currentPlayTile === noPlayer) {
      this.state = noPlayer;
      this.img = new Image();
      this.img.src = this._canvas.toDataURL(); 
      this._canvasContext.fillRect(this.rectXCoOrd, this.rectYCoOrd, baseWidth, baseHeight);
    } else if (currentPlayTile === playerO) {
      this.state = playerO;
      this._canvasContext.fillRect(this.rectXCoOrd, this.rectYCoOrd, baseWidth, baseHeight);
      this._canvasContext.beginPath(); 
      this._canvasContext.arc(this.circleXCoOrd, this.circleYCoOrd, this.circleRadiusNumber, this.circleStartAngle, this.circleEndAngle); 
      this._canvasContext.stroke();
      this.img = new Image();
      this.img.src = this._canvas.toDataURL();
    } else if (currentPlayTile === playerX) {
      this.state = playerX;
      this._canvasContext.fillRect(this.rectXCoOrd, this.rectYCoOrd, baseWidth, baseHeight);
      this._canvasContext.beginPath();
      this._canvasContext.moveTo(this.crossXCoOrd, this.crossYCoOrd);
      this._canvasContext.lineTo(this.crossXStart, this.crossYStart);
      this._canvasContext.moveTo(this.crossXStart, this.crossYCoOrd);
      this._canvasContext.lineTo(this.crossXCoOrd, this.crossYStart);
      this._canvasContext.stroke();
      this.img = new Image();
      this.img.src = this._canvas.toDataURL();
    } else {
      console.log("playTile() - Invalid Argument: " + currentPlayTile);
    }
  }
playTile ( currentPlayTile ) { if ( currentPlayTile === noPlayer ) { this . state = noPlayer ; this . img = new Image ( ) ; this . img . src = this . _canvas . toDataURL ( ) ; this . _canvasContext . fillRect ( this . rectXCoOrd , this . rectYCoOrd , baseWidth , baseHeight ) ; } else if ( currentPlayTile === playerO ) { this . state = playerO ; this . _canvasContext . fillRect ( this . rectXCoOrd , this . rectYCoOrd , baseWidth , baseHeight ) ; this . _canvasContext . beginPath ( ) ; this . _canvasContext . arc ( this . circleXCoOrd , this . circleYCoOrd , this . circleRadiusNumber , this . circleStartAngle , this . circleEndAngle ) ; this . _canvasContext . stroke ( ) ; this . img = new Image ( ) ; this . img . src = this . _canvas . toDataURL ( ) ; } else if ( currentPlayTile === playerX ) { this . state = playerX ; this . _canvasContext . fillRect ( this . rectXCoOrd , this . rectYCoOrd , baseWidth , baseHeight ) ; this . _canvasContext . beginPath ( ) ; this . _canvasContext . moveTo ( this . crossXCoOrd , this . crossYCoOrd ) ; this . _canvasContext . lineTo ( this . crossXStart , this . crossYStart ) ; this . _canvasContext . moveTo ( this . crossXStart , this . crossYCoOrd ) ; this . _canvasContext . lineTo ( this . crossXCoOrd , this . crossYStart ) ; this . _canvasContext . stroke ( ) ; this . img = new Image ( ) ; this . img . src = this . _canvas . toDataURL ( ) ; } else { console . log ( "playTile() - Invalid Argument: " + currentPlayTile ) ; } }
Setup the Canvas Context according to the input type of Tile (Blank, Cross or Circle).
Setup the Canvas Context according to the input type of Tile ( Blank Cross or Circle ) .
// State of the Canvas (DataURL -> Base64 - PNG)
 // Create Base PolyGon
 // Create Circle
