{"size": 1311, "ext": "js", "max_stars_repo_path": "v3/tests/test1.js", "max_stars_repo_name": "jusahah/PromiseMonopoly", "max_stars_repo_stars_event_min_datetime": "2020-08-26T18:59:18.000Z", "max_stars_repo_stars_event_max_datetime": "2020-08-26T18:59:18.000Z", "max_issues_repo_path": "v3/tests/test1.js", "max_issues_repo_name": "jusahah/PromiseMonopoly", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "v3/tests/test1.js", "max_forks_repo_name": "jusahah/PromiseMonopoly", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.8095238095, "max_line_length": 107, "alphanum_fraction": 0.6536994661}
var Promise = require('bluebird');
var _ = require('lodash');
var chalk = require('chalk');

// Protos
var User = require('../User');
var Player = require('../Player');

// Domain objs
var whiteUser = new User('white')
var blackUser = new User('black')

var MoveRound = require('../MoveRound');
var Phase = require('../Phase');
var Game = require('../Game');

var alkujuhla = new Phase('alkujuhla', {loop: false}, []);

var kierroksetPhase = new Phase('kierros', {loop: false}, [
	new Phase('peli', {loop: false}, [
		new MoveRound(
			{ loop: true}
		)
	])

]);

var loppujuhla = new Phase('loppujuhla', {loop: false}, [
	new MoveRound(
		{ loop: false}
	)

])

var tilaisuus = new Game({phases: 0, moverounds: 0}, [loppujuhla, alkujuhla, kierroksetPhase, loppujuhla]);

tilaisuus.register(whiteUser)
.then(function() {
	tilaisuus.register(blackUser);
})
.then(function() {
	tilaisuus.start();
})

setInterval(function() {
	console.log(".");
}, 250);


setTimeout(function() {
	console.log("---- DISCONNECT WHITE ----");
	//whiteUser.disconnect();
}, 6500);

setTimeout(function() {
	console.log("---- DISCONNECT WHITE ----");
	//blackUser.disconnect();
}, 9500);
/** Initialize with initial global state and players participating */
/*
phase1.__initialize({}, [whitePlayer, blackPlayer]);
phase1.__start();
*/