<commit_before>function GameBoardView(app) {
	this.app = app;
}

GameBoardView.prototype = {
	init: function (gameId) {
		this.gameId = gameId;
		this.myTurn = false;

		var self = this;
		this.app.requestGame(gameId, function (game) {
			self.onGameReceived(game)
		});

		for (var i = 0; i < 100; i++) {
			$('#grid1').append('<div data-targetIndex="' + i + '"><div></div></div>');
			$('#grid2').append('<div class="clickable" data-targetIndex="' + i + '"><div></div></div>');
		}

		this.bindListeners();
	},

	destruct: function () {
		this.game = undefined;
		this.ships = undefined;
		$(window).off();
	},

	bindListeners: function () {
		$(window).scroll(this.updatePositions);
		$(window).resize(this.updatePositions);

		$('#goback').click($.proxy(this.onBackClick, this));
	},

	onBackClick: function (event) {
		this.app.switchView('list');
	},

	onGameReceived: function (game) {
		this.game = game;
<commit_msg>refresh game<commit_after>function GameBoardView(app) {
	this.app = app;
}

GameBoardView.prototype = {
	init: function (gameId) {
		this.gameId = gameId;
		this.myTurn = false;

		var self = this;
		this.app.requestGame(gameId, function (game) {
			self.onGameReceived(game)
		});

		for (var i = 0; i < 100; i++) {
			$('#grid1').append('<div data-targetIndex="' + i + '"><div></div></div>');
			$('#grid2').append('<div class="clickable" data-targetIndex="' + i + '"><div></div></div>');
		}

		this.bindListeners();
		this.listen();
	},
	
	listen: function () {
		var self = this;
		
		this.listener = setInterval(function () {
			self.app.requestGame(self.gameId, function (game) {
				
				self.onGameReceived(game)
			});
		}, 2000);
	},

	destruct: function () {
		this.game = undefined;
		this.ships = undefined;
		$(window).off();
	},

	bindListeners: function () {
		$(window).scroll(this.updatePositions);
		$(window).resize(this.updatePositions);

		$('#goback').click($.proxy(this.onBackClick, this));
	},

	onBackClick: function (event) {
		this.app.switchView('list');
	},

	onGameReceived: function (game) {
		console.log('updating game...');
		this.game = game;

{'fraction_non_alphanumeric': 0.20570071258907363, 'fraction_numerical': 0.007600950118764846, 'mean_word_length': 3.9320843091334896, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 19, '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': '6169811', 'n_tokens_mistral': 829, 'n_tokens_neox': 739, 'n_words': 132}