<commit_before>var Board = require('./board');
var Constants = require('./constants');

var Game = {
  isOver: function() {
    return this._consectutivePasses >= 2;
  },

  getCurrentPlayer: function() {
    return this._currentColor;
  },

  getBoard: function() {
    return this._board;
  },

  play: function(player, coords) {
    if (this.isOver())
      throw "Game is already over";

    if (player != this._currentColor)
      throw "Not player's turn";

    this._board.play(this._currentColor, coords);
    this._consectutivePasses = 0;
    this._switchPlayer();

    return this;
  },

  /*
   * At any point in the game, a player can pass and let his opponent play
   */
  pass: function(player) {
    if (this.isOver())
      throw "Game is already over";

    if (player != this._currentColor)
      throw "Not player's turn";

    this._consectutivePasses++;<commit_msg>Game updates to new board state<commit_after>var Board = require('./board');
var Constants = require('./constants');

var Game = {
  isOver: function() {
    return this._consectutivePasses >= 2;
  },

  getCurrentPlayer: function() {
    return this._currentColor;
  },

  getBoard: function() {
    return this._board;
  },

  play: function(player, coords) {
    if (this.isOver())
      throw "Game is already over";

    if (player != this._currentColor)
      throw "Not player's turn";

    this._board = this._board.play(this._currentColor, coords);
    this._consectutivePasses = 0;
    this._switchPlayer();

    return this;
  },

  /*
   * At any point in the game, a player can pass and let his opponent play
   */
  pass: function(player) {
    if (this.isOver())
      throw "Game is already over";

    if (player != this._currentColor)
      throw "Not player's turn";

    this._consectutivePasses++;
{'fraction_non_alphanumeric': 0.13082039911308205, 'fraction_numerical': 0.0022172949002217295, 'mean_word_length': 2.967032967032967, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5139212', 'n_tokens_mistral': 576, 'n_tokens_neox': 545, 'n_words': 159}